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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started