Question: I have a MATLAB code where i am trying to upload my recorded audio signal, and trying to downsample it by an integer, but i
I have a MATLAB code where i am trying to upload my recorded audio signal, and trying to downsample it by an integer, but i keep getting the same errors as below, please help me fix this code so that is works fine. Please also show me the code of the plot after we downsample the signal. Thanks!!
ACTUAL CODE:
para = load('para.mat'); % load the parameters Fs = para.myParameter(1); nbits = para.myParameter(2); n_channel = para.myParameter(3); T = para.myParameter(4);
data = load ('audio1.mat') ; %load the voice signal
% signal amplitude are integers ranging from sig = 2^(nbits - 1)*data.myRecording(:);
Fs = 10000; t_p = 1/Fs; t = [0:t_p:2]; y = data; soundsc(y,Fs) z = downsample(y,4); soundsc(z,Fs/4)
length(y);
ERRORS:
Error using soundsc (line 25) Audio data must be real and floating point.
Error in downsampling (line 17) soundsc(y,Fs)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
