필터 지우기
필터 지우기

i have a signal with many frequencies. how to remove a particular frequency and reconstruct the signal.

조회 수: 106 (최근 30일)
I heard about doing fft and then ifft but don't know how to implement. for example, the frequencies are close to each other as ( 0.1282 0.5128 0.8974 1.1538) now, how can I remove only 0.5128 Hz frequency and reconstruct the signal.
I've attached my data file and frequency finding code.

답변 (2개)

Star Strider
Star Strider 2017년 9월 3일
Try this filter:
signal = load('datee.txt'); % Signal Vector
signal = detrend(signal,0);
Fs = 10; % Sampling Frequency (Hz)
Ts = 1/Fs; % Sampling Interval (sec)
tv = linspace(0, 1, numel(signal))*Ts; % Time Vector
Fn = Fs/2; % Nyquist Frequency (Hz)
Wp = [0.503 0.523]/Fn; % Passband Frequency (Normalised)
Ws = [0.483 0.543]/Fn; % Stopband Frequency (Normalised)
Rp = 1; % Passband Ripple (dB)
Rs = 50; % Stopband Ripple (dB)
[n,Ws] = cheb1ord(Wp,Ws,Rp,Rs); % Filter Order
[z,p,k] = cheby1(n,Rs,Ws,'stop'); % Filter Design
[sossb,gsb] = zp2sos(z,p,k); % Convert To Second-Order-Section For Stability
figure(5)
freqz(sossb, 2^16, Fs) % Filter Bode Plot
filtered_signal = filtfilt(sossb, gsb, signal); % Filter Signal
figure(6)
subplot(2,1,1)
plot(tv, signal)
grid
subplot(2,1,2)
plot(tv, filtered_signal)
grid
This designs a narrow Chebyshev Type I bandstop filter. Experiment with the filter stopbands and passbands to get the result you want.
To use it with my previous code, append it to the end of my previous code, and substitute this assignment:
signal = load('datee.txt'); % Signal Vector
with this one:
signal = filtered_signal;
  댓글 수: 4
rohith bharadwaj
rohith bharadwaj 2017년 9월 5일
Thank you so much. THe code is working and I'm getting the output. Thank you :-)

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


Image Analyst
Image Analyst 2017년 9월 3일
편집: Image Analyst 2017년 9월 3일
Find the index for that frequency, and set it to 0, then call ifft().
See attached demo (though it's for a 2-D image, not a 1-D signal though the concept is the same).
  댓글 수: 1
rohith bharadwaj
rohith bharadwaj 2017년 9월 4일
thanks for the help. but can I get the code like, enter the frequency to remove: like scanf in C and then get the reconstructed signal by removing this frequency

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

카테고리

Help CenterFile Exchange에서 Get Started with Signal Processing Toolbox에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by