MATLAB: I want to find and hear the frequency responce of a .wav file using following equation y(n)=y(n-1​)-0.9*y(n-​2)+x(n)+x(​n-1) but still its giving error and sound after applying freq responce is not audible.the code is following

audioFilter Design ToolboxfrequencyFrequency Domain System Identification Toolbox

PathOriginal = fullfile('C:\Users\Desktop\assigmnt', 'Voice 002.wav');
[y, Fs, n] = wavread(PathOriginal);
b=[1 1];
a=[1 -1 0.9];
y(n)-y(n-1)+0.9*y(n-2)=x(n)+ x(n-1);
[H,w]=freqz(b,a,n,Fs);
player=audioplayer(y, Fs);
play(player);
player2=audioplayer(H,w, Fs);
play(player2);
what change should i have to applied for desired output responce? help please

Best Answer

Hi Lione,
It would be good if you can post the error that you are getting. From a quick glance, the second call to audioplayer is incorrect.
audioplayer(H, w, Fs)
will assume w is the sample rate and Fs is the bits per sample. That could be the cause for the error.
Dinesh