How to plot an audiowave when they have two different vector lengths?

1 view (last 30 days)
I want to find the plot of the following code but I keep getting an error saying the vectors must be of the same length. Its telling me the vector value for n is 1x190913double and z is 190912x1double. Is there a way to plot both of these together?
Thanks
n=0:1:190912;
h=0.1*(0.99).^n;
Fs=16000;
z=audioread('Audio1.wav');
a=conv(z,h);
variabl1=audioplayer(z,Fs);
%play(variabl1);
variabl2=audioplayer(a,Fs);
play(variabl2);
plot(n,z);

Answers (1)

Walter Roberson
Walter Roberson on 13 Oct 2015
[z, Fs] = audioread('Audio1.wav');
n = 0 : size(Z,1)-1;
h=0.1*(0.99).^n;
a = conv(z, h);
variabl1=audioplayer(z,Fs);
%play(variabl1);
variabl2=audioplayer(a,Fs);
play(variabl2);
plot(n,z);
Note: you probably want
a = conv(z, h, 'same')

Categories

Find more on Audio I/O and Waveform Generation in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!