ΣSigmaStudio Ask AI Русский Log in

Divide sine wave osclillator

SigmaDSP & SigmaStudio Vincent Mar 7, 2010 00:00 5 replies Original on forum ↗
Subscribe
Vincent Question
Mar 7, 2010 00:00

Hello,

I have setup a 38kHz sine wave osclillator block. Is there any way to divide the 38kHz by 2?

I need 38kHz and 19kHz and the phase between both should stay intact. I already used two seperated oscillators but the phase keeps shifting in time.

Vincent.

ADIApproved Reply
Mar 9, 2010 00:00

Hello Vincent,

Since the higher frequency you want is a multiple of the lower frequency, you could get two outputs in phase by multiplying the output of a tone generator by itself. When you multiply a 19 kHz tone by itself, you will get sum and difference frequency outputs at 38 kHz and at 0 Hz. Of course, you should high-pass filter the multiplier output so that you're not actually getting the dc (0 Hz) output. Because both the 19 and 38 kHz tones are generated from the same tone generator, they will always retain the same phase relationship.

A very basic implementation of this is shown below. In this example, the output at DAC0 will be 19 kHz, and the output at DAC1 will be 38 kHz and dc (unfiltered). You can find more detailed description of a frequency mixer at Wikipedia.

ac97f0c3236399b2689c190a095e64e2.jpg
ac97f0c3236399b2689c190a095e64e2.jpg
ac97f0c3236399b2689c190a095e64e2.jpg-450x173.jpg
ac97f0c3236399b2689c190a095e64e2.jpg-450x173.jpg
ADIApproved Reply
Mar 9, 2010 00:00

Vincent,

Remember that you must keep all signals output from the DSP at or below the Nyquist frequency, which is half of the sampling rate. Since you're outputting a 38 kHz tone, you must be sure to set your project's sample rate to 88.2 kHz, 96 kHz or 192 kHz.

Vincent.Bruinink Reply
Mar 11, 2010 00:00

Hi Jerad,

Thanx!

I thought that I had to multiply the 19kHz sine with a constant value (2) but after comparing the multiply function with a hardware multiplier things get clear now. I have already filtered out the DC component of the 38Khz output and now there is a clean 38kHz sine wave.

I'm a beginner when it comes to digital audio processing so there are a lot of things I need to look over before I understand them.

@Brett,

I have already set the sample rate to 192kHz. I was aware of this since the output of the osclillator (which was set to 19kHz) was outputing 9.5kHz :-S

Thanx for the quick reply!

ADIApproved Reply
Mar 11, 2010 00:00

Vincent,

I'm glad to hear that this is working for you. Good luck with the rest of your development.

EZAdministrator Reply
Aug 2, 2018 00:00

This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.

Thank you,
EZ Admin