cutoff frequency for lowpass filter
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
Hello!
To get the cutoff frequency when using lowpass() function, I used powerbw(x,Fs) function.
Is this correct?
Thanks
채택된 답변
Star Strider
2020년 5월 11일
0 개 추천
‘Is this correct?’
That depends on the signal, and on what you want to do. The powerbw funciton returns the -3 dB frequencies if you request them (see: Bandwidth of Bandlimited Signals). For a lowpass filter, you would likely use the fhi output, if the intent is to use that part of the spectrum, or flo to exclude it.
It is probably as good a method as any of choosing a frequency for a filter. (I characteristically calculate the fft of the signal and then use it to design the filter, however there a definitely other ways.)
댓글 수: 10
Below is part of the signal that should be fitered. lowpass output signal seems good in other parts of the signal, but I'm a bit worried about how lowpass() filter works at these peaks.
- I tried using 0.99 power point as the cutoff frequency too. But this doesn't make any good significant difference to the output signal.
- filtfilt gives results almost like lowpass (for filtfilt, b=0.2 was used here, using trial and error)
- filter gives an output signal which is still a bit noisy.(for filter, b=0.2 was used here, using trial and error)
Any recommendations on which signal is suitable?(Like, which is with lesser noise but still a good representation of the data)
Any recommendations on any other ways I can make the lowpass output signal better(by changing cutoff frequency, maybe?)

Thank you!!!
I get the impression that ‘filtfilt’ was a simple FIR filter, however it would be nice to know for sure.
The signal has a sharp transition (step discontinuity) at about 12400. All filters are going to have problems with abrupt transitions. This (and the accompanied ‘ringing’ is known as the Gibbs phenomenon and is a well-known problem in signal processing (continuous and discrete). One way of dealing with that is to use a longer (higher-order) filter, however that has its obvious limitations.
I cannot see the lower limit of that discontinuity, however the magnitude of the ‘ringing’ that is visible does not appear to be significantly different from the magnitude of the other signal characteristics. It is likel;y best to simply ignore it. However if the discontinuity itself is a problem, dealing with it depends on what you want to do with the data. Thresholding it and interpolating over it is one possibility, using a sufficiently restrictive lowpass filter to eliminate it is another. The best way to analyse it would be to do a fft on it and then design a filter to eliminate the undesirable frequencies.
Example Fourier Transform code —
t = linspace(0, 5, 1000); % Create Time Vector
s = sum(sin([1; 15; 30]*2*pi*t)); % Create Signal
Ts = t(2); % Sampling Interval
Fs = 1/Ts; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
L = numel(t);
n = 2*nextpow2(numel(s));
FTs = fft(s-mean(s), 2^n)/L;
Fv = linspace(0, 1, fix(2^n/2)+1)*Fn; % Frequency Vector
Iv = 1:numel(Fv); % Index Vector
figure
plot(Fv, abs(FTs(Iv)))
grid
.
Sorry! I don't know how to recognize difference between FIR and other filters.
How do we select the cutoff frequency by looking at fft plot?
Star Strider
2020년 5월 11일
No worries!
FIR filters are finite-impulse response filters. In transfer function representation, ‘b’ is a vector (usually summing to 1) and ‘a’ is 1.
The fft plot will show the frequency content of the signal. Use that information to decide what frequencies to retain and what frequencies to reject. Then, design the filter appropriately.
Thank you very much!! :D
Star Strider
2020년 5월 11일
As always, my pleasure!
Hello again,
If the filtfilt filter I have used is a FIR filter, does it need any modifications/aterations to match with the original filter or what I have already done is fine?
Thanks
As always, my pleasure!
If it gives you the result you want, then leave it alone. If it does not, you may need to re-design it.
I get the impression that ‘filtfilt’ is something like this:
y_filt = filtfilt(0.2, 1, y);
however I do not know for certain.
I might mention here that if you have a variable or function named ‘filtfilt’, it is best to re-name it to something else. Naming variables or other functions the same as MATLAB built-in functions is called ‘overshadowing’ and is to be absolutely avoided.
This is not a designed function. I used the matlab in-build function filtfilt. And those are exactly what I used for b and a(They are just trial and error). The output signal seems to be similar as the output signal from lowpass filter. So, I feel like the output is ok. I was worried if there can be any changes to the signal that is unrecognizable by just looking at the output signal plot. (Also, like those weird things happening near the peaks).
Thank you!!
Star Strider
2020년 5월 12일
As always, my pleasure!
No worries — I just want to be sure that you are not overshadowing filtfilt.
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
