Help IFFT can not restore to original signal after filtering
Show older comments
I tried to compare original signal and signal after high pass filter using ifft. but the result seems odd to me. Can anyone explain why its happened
here is my code
%USING REAL SIGNAL
data_full=load("sig_tremor.txt");
data=data_full(:,2);
srate=100;
t=data_full(:,1);
n=length(t);
figure(1)
subplot(211), plot(t,data), hold on
% HIGH PASS FILTER (SIGNAL*KERNEL)
X=fft(data);
hz=linspace(0,srate,n);
subplot(212), plot(hz,2*abs(X)/n,'-b')
hold on, set(gca,'xlim',[0 10])
% applying high pass filter --> multiplied by kernel
% hz+10 indicate how high freq can be passed
filterkernel = (1./(1+exp(-hz+1)));
XHP=X.*filterkernel;
subplot(211), plot(t,real(ifft(XHP)),'r')
xlabel('Time'), ylabel('Amplitude')
legend('original','HP filter')
subplot(212), plot(hz,2*abs(XHP)/n,'r')
set(gca,'xlim',[0 10],'xtick',[0:2:25])
xlabel('Frequency')
legend('original','HP filter')
hold off
Accepted Answer
More Answers (0)
Categories
Find more on Digital Filter Design in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



