Rockbox mail archiveSubject: Re: DSP: low pass filter
Re: DSP: low pass filter
From: Tomas <tomas_at_salfischberger.nl>
Date: Mon, 15 Aug 2005 01:26:23 +0200
Thanks, we got to the point that averaging is enough on IRC tonight
too... but we had no way to calculate how many samples to average...
Am I right if I think that we follow the Nyquist-Shannon sampling
theorem to decide we need 2 times the bandwidth as a samplingfrequency?
Because of that we devide 44100 by 2 = 22050, and then we use 128
samples for the average, so we do 22050 / 128 = (approximately) 172,27
So for 120 Hz we would do 22050 / 120 = 183,75, so with 184 samples we
would have a (very rough) 120 Hz cutoff. Ofcourse 128 is a way better
number, and 180 Hz is good too... but am I right with this calculation?
Dave Hooper wrote:
> Hold on, hold on. A low-pass filter is WAY easier than an FFT - FFT
> is overkill for beat detection. Check out implementations of
> Butterworth FIR filters, or even just hack something together by
> averaging a bunch of samples together: at 44.1kHz, if you average
> 128 samples at a time, you have a rough-and-ready 180Hz filter.
> The existing peakmeter code looks at peaks over a frame-worth of
> samples - you just change that so that it builds an average every 128
> samples, and then looks at peaks across all of those averages.
> Should be a piece of cake.
Received on 2005-08-15