I am doing an IFFT of frequency response data achieved with Simulation tools.
When I plot my impulse response it looks wrong as the response does not tend to zero as it should. Instead there seems to be a rise in pressure towards the end of the signal.
My script looks like this:
close all; clear all; A = load('PvaluesAtReceiver.txt'); f = A(:,1); Preal = A(:,2); Pimag = A(:,3); Prealpad = cat(1,Preal,zeros(48000-180,1)); Pimagpad = cat(1,Pimag,zeros(48000-180,1)); fpad = cat(1,f,zeros(48000-180,1)); enter preformatted text here j = sqrt(-1); Prealf = Prealpad(88:177); Pimagf = Pimagpad(88:177); ff = fpad(88:177); Prealfpad = cat(1,Prealf,zeros(48000-90,1)); Pimagfpad = cat(1,Pimagf,zeros(48000-90,1)); ffpad = cat(1,ff,zeros(48000-90,1)); X_ff = Prealfpad + j*Pimagfpad; X_ff = [zeros(ff(1),1); X_ff]; IRf = ifftshift(X_ff); x_tf = ifft(IRf); figure,plot(real(x_tf)), title('Impulse response filtered');
This produced the following plot:
Does anyone know why this doesn't tend to zero??
This is the frequency domain i want to transform.