필터 지우기
필터 지우기

How to apply a bandstop filter after performing FFT

조회 수: 1 (최근 30일)
Joydeb Saha
Joydeb Saha 2021년 6월 16일
댓글: Walter Roberson 2021년 6월 17일
How to apply a bandstop filter after performing FFT on the this data, to remove the spikes ? SC is the data matrix.
rows1 =length(SC(:,2));
incr1=1/(rows1+1)*12;
fmax1=12*(1-1/(rows1+1));
X1=[0:incr1:fmax1/2]';
Y1 = abs(fft(SC(1:rows1,2),rows1));
  댓글 수: 5
Joydeb Saha
Joydeb Saha 2021년 6월 17일
OK, I understood. But how to use the bandstop filter after the fft on this data.
Walter Roberson
Walter Roberson 2021년 6월 17일
Example:
data = randn(1, 50);
plot(data)
title('original data');
Y1 = fft(data);
bins_of_interest = 5:22;
damping = exp(-(1:length(bins_of_interest)));
Y1(bins_of_interest) = Y1(bins_of_interest) .* damping;
Y1(end+2-bins_of_interest) = conj(Y1(bins_of_interest));
back_data = ifft(Y1);
whos back_data
Name Size Bytes Class Attributes back_data 1x50 400 double
plot(back_data)
title('reconstructed')
Your bins_of_interest should be chosen according to the sampling frequency and the number of points, and which frequencies you want to filter out; one of the links I posted shows how "wide" each bin is. Your "damping" could be constant or could be any curve that is appropriate for your circumstances, in recognition that you might not be wanting to filter each frequency equally.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Frequency Transformations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by