Shop OBEX P1 Docs P2 Docs Learn Events
Understanding Signals - Try to match example — Parallax Forums

Understanding Signals - Try to match example

Jim McCorisonJim McCorison Posts: 359
edited 2005-01-24 22:44 in Learn with BlocklyProp
I'm working on the Understanding Signals class. I'm trying to match the example that the book shows in figure 3-12 of the 8kHz sine wave superimposed on the 800Hz sine wave. The closest I can come is the attached image. If I try and expand the signal by selecting 500mv/div instead of 1v/div it clips the signal at 2.0v as that is the top of the graph if the base line isn't shifted. Shifting the baseline down does no good, the signal is still clipped. The clipped waveform is the second image.

The actual waveform being generated is correct and I have confirmed it using the FFT display.

Am I missing something? Any suggestions?

Thanks,
Jim

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2005-01-10 01:02
    The first image looks good, except perhaps for amplitude. It shows a low-amplitude 8 Khz wave super-imposed on a higher amplitude 800 hz sine wave. Were the two supposed to be the same amplitude?
  • Jim McCorisonJim McCorison Posts: 359
    edited 2005-01-10 02:11
    The signal was generated by:

    FREQOUT pin, dur, 800, 8000

    so I would expect they are the same amplitude. There was no other circuitry other that a resistor on the stamp pin, a piezo speaker, and a 1microf cap across the speaker.

    The sample in the book shows a very clear 8,000 Hz signal riding on the wave of the 800 Hz signal. I copied the image out of the pdf file and have attached it.

    Jim
  • tmatma Posts: 27
    edited 2005-01-10 23:19
    Is it possible that you connected the - end of the piezo spkr to Vdd instead of Vss?
    Your signal seems to be riding on top of a positive voltage rather than gound.
    It seems unlikly because the ground connection on your Optascope would short out the +5 and possible damage your BOE.
    I had no problems getting the right waveform on this experiment.
    I recomend that you double check your wiring first
    tma
  • Jim McCorisonJim McCorison Posts: 359
    edited 2005-01-10 23:45
    tma,

    Thanks for the thought. I just set it up again and double/triple checked everything. It is "per the book". And I still get the same results.

    Jim
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2005-01-11 07:07
    Jim,

    Have you tried it without the piezo speaker connected? Those speakers have a complex impedance that might effect your result, by some electro-mechanical resonance effect. You still need an RC circuit to filter the PWM, an RC value around 20 microseconds. I don't have the circuit diagram here. Why is there a 1uF capacitor across the piezo? What is the resistor value?

    Also, look on your oscilloscope for the two frequencies separately:

    FREQOUT pin, dur, 800
    FREQOUT pin, dur, 8000

    Do those show up okay, or are they clipped or otherwise distorted?

    The clipping is puzzling. Do you think it is something in the circuit, or an artifact in the optascope?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Doug PientakDoug Pientak Posts: 16
    edited 2005-01-15 01:16
    Have you tried using different components like the capacitor?· The capacitors in the kit have a pretty large tolerance maybe that one is bad.· Also do other signals from the stamp look correct like the square waves for example?·
    Feel free to email me if you still have questions.·
    dpientak@parallax.com

  • Jim McCorisonJim McCorison Posts: 359
    edited 2005-01-15 01:43
    Tracy,

    I took the speaker out and the only difference it made was that my ears were happier. smile.gif

    The 800 Hz waveform looks fine, but the 8 kHz is no thing of beauty. See attached image.

    Doug,

    I tried a different cap , same value, and it didn't change the results.

    Jim
  • NateNate Posts: 154
    edited 2005-01-24 19:36
    Jim,

    You said "The actual waveform being generated is correct and I have confirmed it using the FFT display."

    Does this mean that the FFT display shows the same shape with both O-scope settings (1V/div and 500mV/div)?
    If it does, this would suggest that·something is corrupted·in the data display portion of the O-scope software (If the FFT portion of the O-scope software can plot the correct plot, the Stamp is producing the correct output, the O-scope is getting the correct data in its data buffer, and the FFT algorithm and plotter is working - The only thing left is the data plot algorithm.)· I would reload the O-scope software, if possible from different source.· The issue could be a bad sector on your HD, or the software source.
    If the FFT is not the same for the different O-scope settings, this is probably·not the problem.
    DISCLAIMMER: You get what you pay for.
    nate
  • Jim McCorisonJim McCorison Posts: 359
    edited 2005-01-24 19:43
    Nate said...
    Does this mean that the FFT display shows the same shape with both O-scope settings (1V/div and 500mV/div)?

    The FFT does not display the data in the same form as the Oscope. But picking out the major and minor wave shapes from the FFT shows that the frequencies are correct, or at least match what I'm asking the stamp to send.

    Nate said...
    DISCLAIMMER: You get what you pay for.

    Are you referring to your advice, or what you perceive to be the usefulness of the scope? If it is the former, I never turn down suggestions and advice, although I may reserve the right to follow them. smile.gif If it is the later, I'm not expecting the USB Oscope to match high-end test equipment. It is an economical learning tool, and will probably be more than adequate for the intended development projects I have in mind.

    Jim
  • NateNate Posts: 154
    edited 2005-01-24 19:54
    Ha-Ha it didn't even occur·to me that you might think I was referring·to the O-scope - I have one and for the price I don't see how anyone could complain.

    I am aware the Display of the FFT is different than the raw signal display - Thus if the FFT display is the same (going from the main·display with differnt V/div settings), I will maintain that there is something wrong with the main display driver.

    DISCLAIMER: I am often wrong.

    nate

    ·
  • Jim McCorisonJim McCorison Posts: 359
    edited 2005-01-24 22:44
    Nate said...
    Thus if the FFT display is the same (going from the main display with differnt V/div settings), I will maintain that there is something wrong with the main display driver.

    Ok. I gotcha. I'll reassemble that project and test it again.

    Nate said...
    DISCLAIMER: I am often wrong.

    My too. But it never stops me from trying. And thankfully those that are more knowlegable don't hesitate to correct me when I'm off in left field.

    Jim
Sign In or Register to comment.