필터 지우기
필터 지우기

How to remove a particular frequency in the fft code?

조회 수: 15 (최근 30일)
Deepika Behmani
Deepika Behmani 2019년 6월 19일
댓글: Deepika Behmani 2019년 6월 19일
I am doing FFT of 1000000 data points. I have attached my FFT code. In this code, i got frequency 10.1 kHz but i want to remove that frequency. what kind of filter i can use and is chebyshev type 1 is suitable for this purpose.
data = csvread('5fr_chdis.csv');
time = data(1:1000000,3);
S = data(1:1000000,4);
Fs = 10^(8); % sampling frequency
T = 1/Fs; % sampling timeperiod
L = 1000000; % length of signal
t = (0:L-1)*T;
f = Fs*(0:(L/2))/L;
f1 = f/1000;
Y = fft(S);
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
plot(f1,P1)
title('Frequency spectrum')
xlabel('frequency (kHz)')
ylabel('Amplitude')
%axis([0 50 ylim])
axis([100 200 0 0.2])

채택된 답변

Walter Roberson
Walter Roberson 2019년 6월 19일
[~, idx] = min(abs(f - 10.1)); %which bin is closest to 10.1 ?
Y(idx) = 0; %zero that bin
Y(end-idx+2) = 0; %zero its complex conjugate
  댓글 수: 1
Deepika Behmani
Deepika Behmani 2019년 6월 19일
if i understand clearly bin means closest frequency to 10.1, that is 10 . correct me if i am wrong. and if i put that closest bin in place to f then where should i implement your code in my code?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by