Sampling, Aliasing, Nyquist. How fast is fast enough?
yarisboy
Posts: 245
Hi,
I'd like to be able to sample at 20 kHz. The rub is I'll have six channels to monitor. Can the Propeller handle 120 ksps with a simple I2C interface? I've found a DSP grade muxed A/D chip rated for 400 ksps in Austria but I haven't found a US distributor for it yet.
I'd like to be able to sample at 20 kHz. The rub is I'll have six channels to monitor. Can the Propeller handle 120 ksps with a simple I2C interface? I've found a DSP grade muxed A/D chip rated for 400 ksps in Austria but I haven't found a US distributor for it yet.
Comments
So I'm think you'll most likely be stuck at 400Khz.
That said, I would reconmend using an SPI chip instead of an I2C chip since they have no protocol overhead and are generally able to go faster than I2C.
I can't say what sampling rate would be fast enough but you won't be able to do what you want easily with an I2C chip.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Post Edited (yarisboy) : 7/26/2009 4:57:00 PM GMT
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
····The Nyquist rate is the minimum sampling rate required to avoid aliasing, equal to twice the highest frequency contained within the signal.
········
····where is the highest frequency at which the signal can have nonzero energy.
····To avoid aliasing, the sampling rate must exceed the Nyquist rate:
········.
····To avoid aliasing, the bandwidth must be considered to be the upper frequency limit of a baseband signal [noparse][[/noparse]emphasis mine].
So, at 20KHz, you should be able to sample a signal whose components are all less than 10KHz.
-Phil
Post Edited (yarisboy) : 7/26/2009 11:55:54 PM GMT
Most such situations are in radio type systems where the pertinent information is narrowly concentrated in a relatively narrow bandpass, at a relatively high frequency.
At least, that is how I was taught .... Am I wrong here?
Cheers!
Paul Rowntree
In situations such as the ones you cite, you can shift the spectrum lower by heterodyning and filtering, then sampling at a lower frequency. There's also a technique called "undersampling" wherein you sample at a rate lower than the Nyquist rate and analyze the aliased signals reflected about the sampling frequency from the input frequencies. This may be what you're referring to.
But, to avoid aliasing altogether, you need to sample above the Nyquist rate on signals whose highest frequency components are below half that.
-Phil
I have read in some Tetronix manual, as a rule of thumb, that sampling at 5 times the input frequency is good for windowing and FFT in signal processing of slightly distorted sine like signals, without spikes. Twice is the minimum. For transient signals, as Phil Pilgim said, "To avoid aliasing, the bandwidth must be considered to be the upper frequency limit of a baseband signal". In practical terms, when the rise time of your signal is deltaT, 10/detaT sampling frequency covers most (>90%) signal energy.
If you just want to sample at 20 KHz, 6-channels, Propeller with 6 COGs, PASM I2C driver in each, can do it. When you multiplex your channels into one, 4-wire high speed SPI, will handle it. Yor HUB RAM will be filled up with data very fast, though.
Istvan
As you seem to have discovered, ViewPort is ideal for your application. You "share" some variables with ViewPort and let the Propeller do what it's best at- getting data from different devices. ViewPort transfers the data to the pc (at up to 2mbps, enough for 200,000 samples/sec at 32bit/sample) and gives you all sorts of tools to analyze your data. It's very extensible right now, but will be even more so with the inclusion of a DDE server and client. Let me know if you need anything. Please keep us updated on your application!
Hanno
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Download a free trial of ViewPort- the premier visual debugger for the Propeller
Includes full debugger, simulated instruments, fuzzy logic, and OpenCV for computer vision. Now a Parallax Product!