+ Post New Thread
Results 1 to 20 of 34

27th May 2019, 00:53 #1
How can I generate Sine wave from any periodic waveform that has low frequency?
I need to generate a low frequency sine wave from any waveforms (square wave, triangle wave, etc.). I know Class D amplifier has high efficiency, but the switching frequency of square wave is very high. Is there any waveforms that has lower switching frequency, and use some filters to generate a sine wave?
Thanks.

Advertisement

27th May 2019, 02:08 #2
Awards:
 Join Date
 Apr 2014
 Posts
 15,186
 Helped
 3460 / 3460
 Points
 74,899
 Level
 66
Re: How can I generate Sine wave from any periodic waveform that has low frequency?
Hi,
There is no specifcation in your post .... thus we have to guess.
"Low frequency" for an RF designer may mean 1MHz....for an audio designer maybe 20Hz ... for another designer it may mean 0.0001Hz.
I don't understand what the switching frequency of a class D amplifier has to do with your application.
And why do you mention efficiency? What voltage and current are you talking about  for both input and output signal? What is the source if the signal? And what is the load/ target of the signal?
*******
Any non sinusoidal signal of a dedicated frequency contains other frequencies.
There may be a problem finding what output frequency you want as output.
> You urgently need to specify the frequency range of interest.
Some ideas:
Input signal > analog LPF > comparator (to get square wave, independent of input signal waveform) > LPF (to get rid of square wave overtones) > sinewave.
Input signal > analog LPF > comparator (to get square wave, independent of input signal waveform) > LPF (to get rid of square wave overtones) > PLL (to multiply frequency) > sine lookup table > DAC > LPF > sinewave.
Input signal > analog LPF > ADC > FFT > select lowest frequency > inverse FFT > DAC > LPF > sinewave.
(This keeps the amplitude of the low frequency signal, the others don't)
Also consider what you expect to happen when the input signal is so low, that noise amplitude becomes significant. Noise contains a lot of signals....which may wrongly be interpreted as "true" input signal.
KlausPlease don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.
1 members found this post helpful.

27th May 2019, 05:09 #3
 Join Date
 Dec 2012
 Location
 New Delhi
 Posts
 1,026
 Helped
 173 / 173
 Points
 5,647
 Level
 17
Re: How can I generate Sine wave from any periodic waveform that has low frequency?
Simplest is to construct a Low Pass Filter (LPF) with cutoff frequency just above your 'arbitrary waveforms' 1/T. The higher the filter order the better.
This essentially filters out everything except the fundamental.
For low freq  say below 10khz there are some excellent Switched Cap Filter chips with 8th order lpf. All it needs is power and a switching freq input. e.g. MAX293, MAX294 etcLast edited by kripacharya; 27th May 2019 at 05:15.

27th May 2019, 05:24 #4
 Join Date
 Nov 2012
 Posts
 2,995
 Helped
 727 / 727
 Points
 16,357
 Level
 30
Re: How can I generate Sine wave from any periodic waveform that has low frequency?
I need to generate a low frequency sine wave from any waveforms...
Of course if you want to have a variable centre frequency, you have to do more work.
By the way, a square wave of frequency f (say 10kHz) will have sine wave components of f, 2f, 3f etc (but no subharmonics).
So if you want to have pure sine wave, you have to use a high order band pass filter. But using a digital filter may be simpler in many cases.
1 members found this post helpful.

27th May 2019, 06:35 #5
 Join Date
 Dec 2012
 Location
 New Delhi
 Posts
 1,026
 Helped
 173 / 173
 Points
 5,647
 Level
 17
Re: How can I generate Sine wave from any periodic waveform that has low frequency?
A 'square' wave does not have 1f 2f 3f.... It only has odd harmonics  1f 3f 5f etc
   Updated   
A bandpass filter is much harder to design and achieve than an equal order lowpass. In any case, there is no need for a BPF, unless you are targeting one of the harmonic components.
   Updated   
The design of digital filters is a deceptively complex topic. Although filters are easily understood and calculated, the practical challenges of their design and implementation are significant and are the subject of much advanced research.
In addition the need for appropriate ADC, antialias filters, the actual DSP, develipment environment & toolchains, the DAC, another LPF after DACetc etc would definitely not make it 'simpler'. As illustrated by KlausS above also.
   Updated   
KlausST idea to use a comparator to 'square up' the wave is interesting, since then any 2f component is removed, and the LPF design made easier.
1 members found this post helpful.

27th May 2019, 06:48 #6
Awards:
 Join Date
 Apr 2014
 Posts
 15,186
 Helped
 3460 / 3460
 Points
 74,899
 Level
 66
Re: How can I generate Sine wave from any periodic waveform that has low frequency?
Hi,
KlausST idea to use a comparator to 'square up' the wave is interesting, since then any 2f component is removed, and the LPF design made easier.
In worst case the input signal (including overtones) has more then one zero cross in a (low frequency) period. Making the comparator solution impossible. An LPF in front of the comparator may give improvements.
Another approach could be a LIA (lock in amplifier).
KlausPlease don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.

Advertisement

27th May 2019, 06:52 #7
 Join Date
 Dec 2012
 Location
 New Delhi
 Posts
 1,026
 Helped
 173 / 173
 Points
 5,647
 Level
 17
Re: How can I generate Sine wave from any periodic waveform that has low frequency?
If it has zero cross due to overtones then the LPF will filter it out. I don't see any problem in this.

27th May 2019, 06:55 #8
 Join Date
 Nov 2012
 Posts
 2,995
 Helped
 727 / 727
 Points
 16,357
 Level
 30
Re: How can I generate Sine wave from any periodic waveform that has low frequency?
A 'square' wave does not have 1f 2f 3f.... It only has odd harmonics  1f 3f 5f etc...
A square wave is an odd function and all the even harmonics are absent. But they are there for an arbitrary waveform.
Sorry for the oversight.
1 members found this post helpful.

27th May 2019, 07:00 #9
 Join Date
 Dec 2012
 Location
 New Delhi
 Posts
 1,026
 Helped
 173 / 173
 Points
 5,647
 Level
 17
Re: How can I generate Sine wave from any periodic waveform that has low frequency?
AFAIK lockinamps are used to detect presence of very weak but known frequencies, and not for OP's requirement.

27th May 2019, 07:37 #10
Awards:
 Join Date
 Apr 2014
 Posts
 15,186
 Helped
 3460 / 3460
 Points
 74,899
 Level
 66
Re: How can I generate Sine wave from any periodic waveform that has low frequency?
Hi,
It is not mentioned whether the frequency is known or unknown...
KlausPlease don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.

Advertisement

27th May 2019, 07:47 #11
 Join Date
 Dec 2012
 Location
 New Delhi
 Posts
 1,026
 Helped
 173 / 173
 Points
 5,647
 Level
 17
Re: How can I generate Sine wave from any periodic waveform that has low frequency?

27th May 2019, 09:14 #12
 Join Date
 Jan 2008
 Location
 Bochum, Germany
 Posts
 44,748
 Helped
 13609 / 13609
 Points
 256,485
 Level
 100
Re: How can I generate Sine wave from any periodic waveform that has low frequency?
My principle answer to the original question is:
Use PWM. Sample the input signal with a rate above Nyquist (plus a margin accounting for feasible output filter order). Convert the sample magnitude to respective width of one center aligned pulse. Sinx/x correction required for frequencies near fs/2.

27th May 2019, 16:34 #13
 Join Date
 Jan 2019
 Posts
 255
 Helped
 50 / 50
 Points
 1,257
 Level
 8
Re: How can I generate Sine wave from any periodic waveform that has low frequency?
Nurahmed
please provide some information
what frequency, or frequency range is required?
adjustable or fixed?
harmonic content?
is it necessary to generate from a different wave form?
or can it be generated by an oscillator ?
what voltage and power level?

27th May 2019, 17:26 #14
 Join Date
 Jan 2008
 Location
 Toronto area of Canada
 Posts
 8,674
 Helped
 2025 / 2025
 Points
 49,889
 Level
 54
Re: How can I generate Sine wave from any periodic waveform that has low frequency?
I have used a Switched Capacitor Butterworth Lowpass Filter IC to produce an audio sinewave with extremely low distortion (almost no harmonics) and others used the filter IC to produce a very good sinewave from a squarewave.
The cutoff frequency is set with an internal or external high frequency oscillator.

27th May 2019, 20:46 #15
 Join Date
 Mar 2008
 Location
 USA
 Posts
 6,305
 Helped
 1837 / 1837
 Points
 39,001
 Level
 48
Re: How can I generate Sine wave from any periodic waveform that has low frequency?
Could use a PLL to generate a 2^N*Fin clock, roll a counter
through a sine wave lookup ROM/PROM/EPROM and use that
data to control a second "on time" counter (load) for PWM
creating a sine at the far side of a suitable filter (if it's power)
or just use the PWM logic signal raw (maybe through offset /
gain / filter chain) if small signal.

28th May 2019, 00:25 #16

Advertisement

28th May 2019, 09:50 #17
 Join Date
 Jan 2008
 Location
 Bochum, Germany
 Posts
 44,748
 Helped
 13609 / 13609
 Points
 256,485
 Level
 100
Re: How can I generate Sine wave from any periodic waveform that has low frequency?
Here are the more specific requirements
You didn't yet further explain your initial specification "generate a low frequency sine wave from any waveforms". Literally, the specification seems useless to me. It has been understood in the further discussion as classD like switching power stage and the discussion went on about appropriate carrier frequency, switching pattern etc.
Seeing your latest THD and SNR specification, it becomes clear that some filter effort is involved, and that you shouldn't choose the carrier frequency too low to keep the filter feasible.

28th May 2019, 15:06 #18
Re: How can I generate Sine wave from any periodic waveform that has low frequency?

28th May 2019, 15:12 #19
 Join Date
 Jan 2008
 Location
 Bochum, Germany
 Posts
 44,748
 Helped
 13609 / 13609
 Points
 256,485
 Level
 100
Re: How can I generate Sine wave from any periodic waveform that has low frequency?
Not lower than imposed by the Nyquist criterion. In practice at least 25 to 30 kHz, higher if you want to keep the filter effort low.

28th May 2019, 15:22 #20
 Join Date
 Jan 2019
 Posts
 255
 Helped
 50 / 50
 Points
 1,257
 Level
 8
Re: How can I generate Sine wave from any periodic waveform that has low frequency?
you specified a sin wav up tp 10 kHz, with THD < 5%
where does carrier frequency come in?
carrier frequency implies some sort of modulation.
is there any expected modulation?
+ Post New Thread
Please login