Shop OBEX P1 Docs P2 Docs Learn Events
Sequential 3 tone generation at different levels??? — Parallax Forums

Sequential 3 tone generation at different levels???

FramboFrambo Posts: 4
edited 2011-09-25 16:24 in BASIC Stamp
I have a project that I need to do the following:

1. Send a 2175 Hz tone for 125 ms @ +10dB
2. Send a 1950 Hz tone for 40 ms @ 0 dB
3. Send a 2175 Hz tone for 5000 ms @ -20dB

I understand how to send the above tone with FREQOUT but is there any level control in the BS2?

The tones above need to be sequential with no idle time in between.

Thanks for your help in advance!

Jim

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-09-21 17:58
    There's no built-in level control. You could use a digitally controlled pot as a level control. You could use an op-amp with different switched feedback resistors to set the gain and control the switches (a transistor or other digital switch) with the Stamp.

    There will always be a short time between the tones because the FREQOUT statement takes a little time to execute. EmeSystems has some discussion of execution time. Look at their app-note link.
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2011-09-21 23:34
    Are those power ratios? The voltage ratios to give power ratios of +10 : 0 : -20 dB are
    1 : 0.316 : 0.0316

    You could arrange resistors as a programmable attenuator, with one to the FREQOUT pin, with one directly to ground, and two others to auxiliary pins. When both of the auxiliary pins are INPUTs, you get +10dB, and when one or the other auxiliary pin is made LOW (in between FREQOUTs) you get the other two levels. Have to choose the values to give the correct ratios.

    The higher power level may require an amplifier. For power levels you have to know the impedance. Supposing 0 dBm into a 600Ω load, that takes an RMS voltage of 0.775 V, or peak to peak, 0.775 * 1.414 * 2. = 2.191 V pk to pk. That could conceivably come directly from the Stamp output. But +10dBm into 600 Ω requires about 3 times that voltage, 6.93 V pk to pk. That will take an amplifier.
  • ercoerco Posts: 20,256
    edited 2011-09-23 14:46
    A digital pot like http://www.parallax.com/StoreSearchResults/tabid/768/List/0/SortField/4/ProductID/246/Default.aspx?txtSearch=digital+potentiometer could be used as a voltage divider for level control into an amplifier for level control. As an alternative to FREQOUT, another pot could be used to control a 555 timer oscillator to generate the audio signals.
  • FramboFrambo Posts: 4
    edited 2011-09-25 12:26
    Thanks for all of the input!

    Would the Propeller be a better choice to develop this project with?

    Thanks Again!

    Jim
  • Mike GreenMike Green Posts: 23,101
    edited 2011-09-25 12:45
    With a Propeller, you could use a fixed gain external amplifier to get the +10dB level, then use a simple switched resistor ladder ADC to generate a nice sinewave at one of three levels and one of two frequencies using table lookup. On the other hand, you can also do this project with a Stamp using any of the techniques mentioned. I don't think there's a "better" choice given what information you've provided.
  • FramboFrambo Posts: 4
    edited 2011-09-25 13:03
    Will the propeller still have a lag time between tones?
  • Mike GreenMike Green Posts: 23,101
    edited 2011-09-25 15:08
    There will always be some transition time between tones. The Propeller could make this less than one cycle since it would be synthesizing the waveform directly. In the case of the Stamp, you're still talking about something on the order of a cycle or two.
  • FramboFrambo Posts: 4
    edited 2011-09-25 16:24
    Thanks again.

    I think I will be going with the Stamp for simplicity.

    Jim
Sign In or Register to comment.