how to design bandpass filter with cut off wavelengths given.

6 次查看(过去 30 天)
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 个评论
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