필터 지우기
필터 지우기

how to design bandpass filter with cut off wavelengths given.

조회 수: 6 (최근 30일)
math seeker
math seeker 2018년 2월 22일
댓글: Star Strider 2018년 2월 26일
I have a gridded bathymetry data. I have to remove all signals from the data with a wavelength greater than 4000 km and less than 400 km. How can I design a bandpass filter, eg. Butterworth filter? how do I determine the cut off frequencies and order of the filter? the spacing between grid points is 0.16 km.

채택된 답변

Star Strider
Star Strider 2018년 2월 22일
This will work for a filter design:
Ts = 0.16; % Sampling Interval (Units: km)
Fs = 1/Ts; % Sampling Frequency (Units: 1/km)
Fn = Fs/2; % Nyquist Frequency
Freq1 = 1/4000; % Convert Wavelentgh To Frequency (Units: 1/km)
Freq2 = 1/400; % Convert Wavelentgh To Frequency (Units: 1/km)
Wp = [Freq1 Freq2]/Fn; % Passband Frequencies (Normalised)
Ws = Wp.*[0.8 1.2]; % Stopband Frequencies (Normalised)
Rp = 1; % Passband Ripple
Rs = 50; % Stopband Ripple
[n,Wn] = buttord(Wp,Ws,Rp,Rs); % Filter Order
[z,p,k] = butter(n,Wn); % Calculate Filter
[sos,g] = zp2sos(z,p,k); % Convert To Second-Order-Section
figure(1)
freqz(sos, 2^16, Fs) % Filter Bode Plot
set(subplot(2,1,1), 'XLim',[0 0.05])
set(subplot(2,1,2), 'XLim',[0 0.05])
The Bode plot of the filter amplitude appears to have strange units, with the filter appearing to ‘amplify’ the signal. This is due to the way freqz calculates filter gain, not the design of the filter. The filter will not amplify your signal.
I leave the implementation to you, because I have no idea what you are doing.
  댓글 수: 4
math seeker
math seeker 2018년 2월 26일
The line
freqz(sos, 2^16, Fs)
gives me an error.
error: freqz: B must be a vector
Star Strider
Star Strider 2018년 2월 26일
The code in my Answer runs without errors in R2017b. (I copied it from my post and ran it again just now, to be sure.)
I have no idea what your problem could be, since you only posted the freqz call.

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

추가 답변 (1개)

Abhishek Ballaney
Abhishek Ballaney 2018년 2월 22일
https://in.mathworks.com/help/signal/ref/butter.html

카테고리

Help CenterFile Exchange에서 PHY Components에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by