High Frequency Sine Wave

Status
Not open for further replies.

MarColnaghi

New member
Hello everybody!
I'm currently moving my first steps into the teensy world! I'm glad I found a super strong community, and I'm hoping in the future I'll be able to help you out.

Right now I'm trying to implement a Sine Wave generator precise enough to create pure tones using a piezoceramic speaker.
Using the audio library and the sine function, I'm able to generate waveforms in the DAC of both a 3.5 and a 3.6 teensys, but at high frequency (which I need to achieve for my project), the produced wave doesn't appear to be a sine at all.

I was wondering whether it was possible to generate 15-16kHz tones with the teensy in the first place and secondly, if that is possible, if my only chance would be to low-pass filter the signal.

Finally, I want to add that I own an audio shield too. Maybe that can help me tackle this problem?

Thanks to everybody!
Have a nice day,
Marco
 
The built-in general purpose DACs don't have reconstruction filters as they don't know what the sampling rate you want is
(the audio shield would be an improvement for this, audio sigma-delta DACs tend to have very high effective sampling rates).
Without a reconstruction filter you'll get "first-order hold" behaviour, meaning spurious tones at image frequencies, especially
as the wanted frequency approaches the Nyquist rate (half the sampling rate).

I'm not familiar with the max sample rate possible with the built-in DACs, but if you can increase that it will help reduce the
strength of the out-of-band image frequencies. Try running the audio lib at 96kSPS or similar?

Or you could interface to a DDS chip and offload all the work to that? 25MHz sample-rate AD9833 breakouts are readily
available for instance.
 
Status
Not open for further replies.
Back
Top