Hacker News new | ask | show | jobs
by a-dub 808 days ago
bandpass filtering in the time domain seems like it may be more efficient for this use case to me. if i'm reading the code correctly, it seems it's computing a 512 point window and fft on every non-overlapping window.

i guess it depends on what vector/matrix instructions are being used in the underlying implementations.

1 comments

I'm also curious about the power draw of continuously executing FFTs on a rpi.

Seems like the kind of task where one could easily burn 10 watts, if the wrong FFT Implementation is chosen. You'd absolutely want to do this in DSP hardware.

yeah using a DSP for this definitely makes more sense - but I'm lacking experience in the field. Same goes for using a discrete band-pass filter. This project is more of an attempt at "how can I build something in 2 hours that works reliably" !

For reference, it eats ~25% of the available CPU resources on my rpi zero 2w - which draws a maximum of 350mA, so this implementation definitely draws less than 1 watt.

1W of continuous power consumption is not great. To put it into perspective: that’s 1x24x365Wh, almost 9kWh per year. A kettle (1.8-2kW) can run for 4-5 hours for that amount of energy. If getting a kettle to boiling takes 5 minutes, that’s almost 50-60 kettles. That’s two month of boiling one kettle a day.
Or, at the rate of $0.30/kWh in California for residential use, $2.70/year. Lowering power usage on embedded devices is important when you're producing thousands, but for a hobbyist it doesn't really matter.
Nice to see that it consumes barely any power. Looks like a fun and useful project!
yes and it's very cool! if you're interested in learning, i'd look into the filtering approach.

maybe could try pyfda and the filtering functions in scipy.signal to start playing around.

or if you have access to matlab it has some really excellent filter design tools.

regarding the hardware/dsp: many cpus include simd instructions these days, which basically are an interface to a hidden digital signal coprocessor. :)