Shop OBEX P1 Docs P2 Docs Learn Events
Propeller Application DEMO: Spectrum Analyzer (for Audio) — Parallax Forums

Propeller Application DEMO: Spectrum Analyzer (for Audio)

Beau SchwabeBeau Schwabe Posts: 6,568
edited 2009-04-22 15:52 in Propeller 1
Ok, so this one is just a must read.· I've known about this technique for quite some time, but it was just a matter of making it happen and brining
my head around it enough to understand and explain how it works.· You can't beat results like this with only 5 passive components and a Propeller board.


Ok, so it's not·fast, but it is rather impressive. (I'm excited about it anyway)
Have fun!!





▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe

IC Layout Engineer
Parallax, Inc.

Post Edited (Beau Schwabe (Parallax)) : 7/27/2007 5:10:45 AM GMT
320 x 240 - 10K
320 x 240 - 10K
«1

Comments

  • RinksCustomsRinksCustoms Posts: 531
    edited 2007-07-27 05:37
    It's a thing of BEAUty! lol It really is neat! I can't wait to tool with this one.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    E3 = Thought

    http://folding.stanford.edu/·- Donating some CPU/GPU downtime just might lead to a cure for cancer! My team stats.
  • epmoyerepmoyer Posts: 314
    edited 2007-07-27 07:27
    Excellent job; that's very impressive. I absolutely love it!
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2007-07-27 09:52
    neato!
  • ColeyColey Posts: 1,110
    edited 2007-07-27 10:05
    Well done Beau, this is one of my favourites very useful indeed, thank you.

    Regards,

    Coley
  • inserviinservi Posts: 113
    edited 2007-07-27 10:39
    Hello RinksCustoms,

    What mean 'lol' ?

    I read that sometimes and I know only that is for to express a smile or a laughter, but I don't know exactly what want to say each letter L, O and L ?

    Thank-you.

    Best regards,
    dro.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    in medio virtus
  • ciw1973ciw1973 Posts: 64
    edited 2007-07-27 12:19
    That rocks!
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2007-07-27 12:27
    inservi said...
    Hello RinksCustoms,

    What mean 'lol' ?

    I read that sometimes and I know only that is for to express a smile or a laughter, but I don't know exactly what want to say each letter L, O and L ?

    .

    LOL: Laugh Out Loud

    LMAO: Laugh My *** Off

    RFLMAO: Roll on floor laughing my a...

    IMHO: In my humble opinion

    IIRC: If I remember correctly

    FWIW: For what its worth

    TIA: Thanks in advance

    WTF: No comment [noparse]:)[/noparse]

    Graham
  • ColeyColey Posts: 1,110
    edited 2007-07-27 12:31
    Graham Stabler said...
    WTF: No comment [noparse]:)[/noparse]

    Took me a while but I got it in the end.....

    LOL smile.gif
  • BTXBTX Posts: 674
    edited 2007-07-27 13:47
    Beau....
    You're a genius ...very impressive !!! [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • El PaisaEl Paisa Posts: 375
    edited 2007-07-27 14:39
    Beau, this seems to be a semi-log plot, right?
    BTW could give me a example of log-log plot?
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2007-07-27 14:43
    El Paisa,

    The plot is actually just a percentage signal purity fro 0% to 100%

    The Maximum Signal value is calculated, and compared against the Actual Signal value received to obtain a percentage.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • El PaisaEl Paisa Posts: 375
    edited 2007-07-27 15:05
    Beau, you are refering actually to the amplitude of the waveform.

    What I am refering is to the display of the x axis (or frequency) values.

    Looking more carefuly your plots seems are linear plots NOT semi-log plots.

    It is·common·in engineering to plot frequency as log values not linear values.

    If the y axis values is linear and the axis(frequency) is in log values, the plot it is called semi-log plots.

    Another common practice is to plot y as log values and x also as log values, then is called log-log plots.
  • El PaisaEl Paisa Posts: 375
    edited 2007-07-27 15:11
    In all my previous discusions I am refering log values with the base of 10 ie 2=log(100)
  • potatoheadpotatohead Posts: 10,261
    edited 2007-07-27 15:16
    Isn't this something easily added or changed? The hard stuff is the wave calcs.

    Very cool, and I've a few uses for this.

    Appreciated!

    If one were interested in a more narrow bandwidth, what would be the best approach?

    This is pretty narrow, and not a problem for what I plan to do with it. Just wondering where to do some additional learning, that's all.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2007-07-27 15:35
    potatohead,

    "If one were interested in a more narrow bandwidth, what would be the best approach?" Increase the number of "Poles" that are used.
    Doing so though affects the upper frequency limit which btw is somewhere near 500kHz (1/4 of the maximum Bit Sample rate.)

    El Paisa,
    yes, you are correct, the X dimension is linear, and as potatohead said... most of the hard stuff is already done.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • parts-man73parts-man73 Posts: 830
    edited 2007-07-28 17:01
    Beau,

    Very cool app, I plan to try it soon. One question though. How are the external components assembled? On the breadboard of a demoboard? soldered to a protoboard? I just remember a discussion in this thread http://forums.parallax.com/showthread.php?p=576575 about ADC and problems involved in using a breadboard. and the importance of getting the components are close to the input pin as possible for good results. I assume that would be important in this example as well.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Brian

    uController.com - home of SpinStudio
  • RinksCustomsRinksCustoms Posts: 531
    edited 2007-07-29 05:11
    Beau is using the mic input on the demo board, or the circuit from it - which is a 1 bit ADC. At least that's what i'm led to believe from the schematic above. I too remember that thread, but IMS (If Memory Serves) he was runing a feedback loop in the nanosecond range in an attempt to see just how fast A/D could be done on that setup.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    E3 = Thought

    http://folding.stanford.edu/·- Donating some CPU/GPU downtime just might lead to a cure for cancer! My team stats.
  • rjo_rjo_ Posts: 1,825
    edited 2007-07-29 12:42
    Beau...

    I've been evangelizing... and the first question that my new friend had after receiving his Propeller Education Kit was...

    "I have this machine at work that they have to pay a guy to baby-sit at night. When the machine goes nuts it makes a lot of noise... can I use the Prop to monitor noise and turn the machine off?"

    "Sure"... says me.

    BIP (Beau is psychic)

    ILMP (I love my Propeller)

    Rich
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2007-07-29 12:54
    Beau,

    You should team up with Chip on this, when the propeller talks it can now listen! You could get the cogs chatting to each other [noparse]:)[/noparse]

    Graham
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2007-08-01 20:49
    Rich,

    ...not a psychic


    Graham,

    You could use it to monitor inter-propeller chatter, but with this version, the frequency limit is about 500kHz.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • rjo_rjo_ Posts: 1,825
    edited 2007-08-01 21:16
    r2
  • Dennis FerronDennis Ferron Posts: 480
    edited 2007-08-01 21:39
    Could you make an audio modem this way?
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2007-08-01 21:48
    Graham,

    There is an application that I was toying with that used PSK (Phase Shift Keying) to transmit data. One micro would generate a particular clock frequency, and the other(s) micro(s) would Phase-Lock to that frequency. The "master" could send constellation data by altering the phase. The other micro(s) would in essence "track" the phase change to reconstruct the transmitted data.

    Combine this with the Spectrum Analyzer, and you could get a spread spectrum style communication.



    Dennis,

    Many modems use "PSK" to transmit data. By defining specific constellation symbols, you can dramatically increase your throughput... This is one of the "tricks" used to transmit data over copper

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 8/1/2007 9:55:38 PM GMT
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2007-08-02 09:17
    Beau,

    When I said talk I meant literally using the speech synthesis stuff

    Graham
  • Brian SmithBrian Smith Posts: 44
    edited 2007-08-03 03:28
    That is really really cool!

    So how do I hook it up to my memsic accelerometer??!

    Oh, and try to dumb it down for me.

    Thanks
  • Piper984Piper984 Posts: 74
    edited 2007-11-05 15:03
    Hello Beau,

    Thanks for this application.· I just purchased the Propeller Demo Board, with the intent of learning more about this topic using your code.

    So, two quick questions:

    1) The schematic in the code on hooking up a microphone... This is slightly different than the electret microphone circuit on the Propeller demo board.· Should I be able to use pins 8 and 9 on the demo board for the output and input pins?· Please advise if I need to do something differenet here.· So far,·I am not getting any good data back.

    2) Could I expect a 16X speed up if I move to an 80Mz clock?

    Thanks again!
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2007-11-05 17:07
    Piper984,

    For #1, you should be able to use the microphone, but you will need to specify those pins correctly in software.
    For #2, If you are using the Demo board, you are already running at 80MHz through the internal PLL

    If you are trying to "listen" to an audio signal to determine if there is a specific frequency present, then the audio needs to sustain that frequency during the entire sample period. If it is not present throughout the entire sample period it will average out as noise and become part of the noise floor, or show up as a very small spike.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • RaymanRayman Posts: 14,826
    edited 2007-11-05 17:14
    Has anybody implemented an assembly FFT routine yet?
  • Piper984Piper984 Posts: 74
    edited 2007-11-05 21:12
    Hi Beau,

    Thanks for the reply. I am new the Propeller, and so now I understand the _clkmode parameter.

    I also understand that the audio needs to be contant for all the scans. I guess when I looked @ the code I didn't realize the amount of time it would take to do the scans. I'll try this later tonight and see if that was my issue.

    Has anyone implemented a similar app using FFT on a single sample using the Propeller?
  • AleAle Posts: 2,363
    edited 2007-11-07 06:22
    I did,

    integer 512 points, in asm of course. I never tested it actually (just partially), i wanted to debug it so I wrote pPropellerSim and later I had to write a paper, sort of progress check for my Ph.D and well got sort of "forgot"... I'll post it, may be someone wants to use it (will be GPL v2, sorry).

    ** This answer goes here.
Sign In or Register to comment.