Divide sine wave osclillator
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.
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.
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.
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!
Vincent,
I'm glad to hear that this is working for you. Good luck with the rest of your development.
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
Please log in to reply.

