Daha büyük adım = dikdörtgen pencere ile kıvrım kullanarak farkı kullanarak bir sinyalin düzeltilmiş türevini hesaplama


9

Ben örneklenmiş bir sinyal var burada i = 0..n-1. Sinyalin ilk türevini bulmak istiyorum: f '(t).Δt:fi(ti=iΔt)

İlk düşüncem bunu merkezi bir farkla tahmin etmekti:

f(ti)=f(ti+1)f(ti1)2Δt

Bununla birlikte, sinyal f 'de hızlı dalgalanmalara neden olabilecek çok yüksek frekanslı gürültüye sahip olabilir. Uygun bir şey, örneğin Hann gibi bir pencere fonksiyonu ile kıvrım yaparak sinyali düzeltmek ve farklardan türev bulmak olabilir sanırım.

Bir meslektaş, türevin düzgün bir tahminini bulmanın daha hızlı bir yolunu önerdi: 2n numuneler üzerinde merkezi bir fark kullanın, burada n >> 1:

f(ti)=f(ti+n)f(tin)2nΔt

Bu, elbette, bir pencere işlevi ile ilk dönme işleminden hesaplamalı olarak daha hızlı olurdu, ancak iyi bir çözüm müdür?

Toplamı oluşturursak:

S=2Δt[f(tin+1)+f(tin+2)+..+f(ti+n1)]

and expand each derivative by the central difference with step Δt:

S=f(tin+2)f(tin)+f(tin+3)f(tin+2)+..+f(ti+n)f(ti+n2)

all terms except two cancels out:

S=f(ti+n)f(tin)=2nΔtf(ti)

Therefore:

f(ti)=1n[f(tin+1)+f(tin+2)+..+f(ti+n1)]

So taking the central difference over 2n samples is equivalent with first convolving by a rectangular window of size 2n - 2 and then taking a central difference over +/- 1 sample.

How "bad" is it to smooth with a rectangular window?

If we take the FFT this will cause "ringing", but we do not need to take the FFT.

Thanks in advance for any answers!

Yanıtlar:


4

This is a hard question to handle generally. Smoothing with a rectangular window is used all the time (often called a "moving average"), so that's not necessarily a problem. I'm not sure what ringing you're referring to, perhaps the sidelobes of the rectangular window's frequency response.

Differentiation is inherently a highpass operation; the ideal continuous-time differentiator has a transfer function of:

H(s)=s

So that its magnitude response is:

|H(jω)|=ω

The gain of a differentiator therefore increases monotonically with frequency. If your signal contains high-frequency noise, then it could be amplified by applying a differentiator. To combat this, two approaches are apparent:

  • Design a more sophisticated differentiator filter that has the desired linear magnitude response over the portion of the band that covers your signal of interest, then sharply attenuates higher frequencies. You could design such a filter using least-squares methods or the frequency-sampling method, for example.

  • Use a cascaded approach where you first suppress all of the high-frequency noise that you can using a lowpass filter, then follow with the differentiator. The frequency coverage of the differentiator need not be as tight since the lowpass filter will eliminate the out-of-band noise.

The methods should be roughly equivalent if you're using linear filters; you could think of the first single-filter approach as just a cascade of a differentiator and a lowpass filter. As you noted, the central-difference approach can be modeled in this way. It's hard for anyone to say that it's "bad" without any knowledge of your application. My main thought would be that it is "bad" if the smoothing operation tangibly attenuates your signal of interest, such that the derivative estimate is no longer useful. However, if the parameters of the signal are such that you can smooth the noise without noticeably distorting the signal (i.e. if the signal is well-oversampled), then it could be a win.

Sitemizi kullandığınızda şunları okuyup anladığınızı kabul etmiş olursunuz: Çerez Politikası ve Gizlilik Politikası.
Licensed under cc by-sa 3.0 with attribution required.