Shop OBEX P1 Docs P2 Docs Learn Events
Can I use a smartpin ADC or the Streamer to measure a Frequency component of an Audio Signal? — Parallax Forums

Can I use a smartpin ADC or the Streamer to measure a Frequency component of an Audio Signal?

jrullanjrullan Posts: 167
edited 2021-01-18 20:47 in Propeller 2
Hello all,

I am trying to implement a spectrum analyzer for an audio signal. TBH I have no knowledge of digital signal processing other than knowing it exists. But upon glancing over the P2 Documentation I noticed that Fourier was mentioned in the DDS/Goertzel mode of the Streamer. This is what the P2 Documentation mentions:
Goertzel analysis can be thought of as a single slice of a Fourier transform, in which energy of a single frequency is measured amid potential noise for some number of NCO cycles. Goertzel analysis returns sine and cosine accumulations which can be converted into polar coordinates using the QVECTOR instruction, yielding power and phase information.

Knowing almost nothing about FFT or the Streamer, I wonder if this feature/mode could be use to detect peaks in a selectable frequency of the audio spectrum for an audio input coming from an audio source's headphones jack.

So my question would be if anyone knows about this and if what I want to do can be done with the P2 streamer ?

Comments

  • cgraceycgracey Posts: 14,133
    You can do swept frequency-power measurements using the Goertzel mode of the streamer.

    If you look in the main silicon documentation, you can see an example of this, but it's using radio frequencies, not audio. You can do swept audio measurements, as well. Maybe what you just need is an FFT program, which I have. You just feed it a set of samples and it converts to power and phase pairs.
  • Your spectrograph would probably do what jrullan's asking, Chip? THe one where you could from one to ten
  • cgracey wrote: »
    You can do swept frequency-power measurements using the Goertzel mode of the streamer.

    If you look in the main silicon documentation, you can see an example of this, but it's using radio frequencies, not audio. You can do swept audio measurements, as well. Maybe what you just need is an FFT program, which I have. You just feed it a set of samples and it converts to power and phase pairs.

    @cgracey
    Thank you for your feedback. Where can I see that FFT program?
  • evanhevanh Posts: 15,215
    The first google doc here - https://forums.parallax.com/discussion/170380/new-p2-silicon
    You'll find it at about a third of the way into that doc under section on DDS/Goertzel

Sign In or Register to comment.