Maker Pro
Maker Pro

Why don't I get a Sine wave?

15302484_1423705977669642_902397143_o.png


So I want to get a sine wave out of the last integrator amplifier. But as you can see, I don't get one, I'm pretty new in this and I would like to know what's happening? I would appreciateany help! Thanks :D

mod: see here for the (fixed) circuit.
 
Last edited by a moderator:

hevans1944

Hop - AC8NS
The last amplifier isn't really an integrator because there is a resistor in parallel with the "integrating" capacitor. This resistor is the reason the output is "curvy" instead of a a linear saw-tooth waveform. But since you are feeding square waves into your "integrator" stage, by what magic did you expect a sinusoidal waveform to appear in the output?
 
Last edited:
You can get a sine wave by building a Wien Bridge Oscillator or a Phase Shift oscillator, or a Bubba Oscillator (love that name)

Bob
 
The last amplifier isn't really an integrator because there is a resistor in parallel with the "integrating" capacitor. This resistor is the reason the output is "curvy" instead of a a linear saw-tooth waveform. But since you are feeding square waves into your "integrator" stage, by what magic did you expect a sinusoidal waveform to appear in the output?

I read here :: http://www.electronics-tutorials.ws/opamp/opamp_6.html
that if I put a tringular wave in the input of an integrator I should get a Sine wave. And in this case the second op amp gives me a trignular wave. What should I do so the third one gives me a sine ?
 

Harald Kapp

Moderator
Moderator
I read here :: http://www.electronics-tutorials.ws/opamp/opamp_6.html
that if I put a tringular wave in the input of an integrator I should get a Sine wave
Where in that reference did you find this statement? I can't find it and it isn't true. All that is stated is that as square wave will be integrtaed into a ramp function and that a sine wave will stiil be a sine wave but with shifted phase.

Mathematically speaking: Int(x)dx = 1/2 x² which is defnitely not a sine function.
 
I'm not sure if the following will be in anyway helpful and I'm not sure if it is correct (disclaimer):
The square wave already contains the sine wave that you are looking for, along with a ton of odd harmonics. I think you can feed the square wave through a low pass filter that blocks all the harmonics (at the very least starting with the first odd harmonic) and you should to my knowledge be left with the fundamental sine wave.
 
I'm not sure if the following will be in anyway helpful and I'm not sure if it is correct (disclaimer):
The square wave already contains the sine wave that you are looking for, along with a ton of odd harmonics. I think you can feed the square wave through a low pass filter that blocks all the harmonics (at the very least starting with the first odd harmonic) and you should to my knowledge be left with the fundamental sine wave.

Of course, this recommendation is "correct". That`s the classical method of transferring a squarewave into a "quasi-sinusoidal" signal. However, one should know that there is no lowpass filter that can "block" unwanted harmonics.
All you can achieve is to reduce the amplitude of harmonics - and the success depends on the filter degree (as large as necessary for the required THD).
 
Yeah, maybe use multiple filters in a row, I think they call it a filter with multiple poles, possibly also use active filters and it should give a pretty good cut-off. Possibly combine different types of filters so that the end result is such that the wanted fundamental is still a good signal and everything else is pretty much at the noise floor. Then just amplify the signal again and voila?
 

hevans1944

Hop - AC8NS
Trying to recover just the fundamental sinusoidal frequency from a square wave, or even from a triangle wave, is the long way around the barn to generating sine waves. It is a lot easier, most of the time, to construct a sinusoidal oscillator in the first place, as @Harald Kapp suggested in his post #4.

That said, many years ago I needed to synthesize audio tones at a dozen or so well-defined frequencies over about a two octave range and produce a sine wave output. The circuit I ended up using was an integrated circuit, Intersil ICL8038, that produced triangle waves (by integrating square waves) and then shaped the triangle waves into fairly good sine waves by means of a "break-point" generator. You could also use an Exar XR2206. Or build your own "wave shaper" to "round off" the peaks of a triangle wave and produce a pseudo-sinusoidal output waveform.

If all you are only interested in is a single frequency, then there are hundreds (perhaps even thousands) of designs out there that generate decent (low harmonic distortion) sine waves.

The Wien Bridge oscillator is a classic design that will produce low-distortion variable frequency sine waves, but this usually requires a dual-potentiometer or a dual variable capacitor for variable frequency control... plus a non-linear circuit element (usually an incandescent filament lamp) for feedback and amplitude control.

Before launching off into the Wien Bridge space, try using a simple one-op-amp, three RC stages, phase-shift oscillator circuit. This circuit can be found on the page Harald linked to.
 
The answer is, why yes it can! (But it sucks)
 

Attachments

  • Screenshot_2016-12-03-11-59-29.png
    Screenshot_2016-12-03-11-59-29.png
    224.9 KB · Views: 69
Last edited:

hevans1944

Hop - AC8NS
Question... could a tank circuit be used as a sinewave generator?
I've created very pretty sine waves with microcontroller/DAC output (filtering also required)
I like LC oscillators, and they generate "pretty good" sine waves, but the microprocessor/DAC look-up table (LUT) approach is simple and, with plenty of data points per cycle, doesn't require very much filtering. IMO, the major limitation is how fast you can cycle through the LUT, which places an upper limit on the frequency you can produce. Easy to prototype to get something running right away, but for RF you generally need to use an LC "tank" circuit.
 
The definition of a pure sine wave is clear.
You need to define the amplitude and frequency(phase).

In practice sine waves are not pure , they have distortions(i.e the deviation from purity).
That is measured in THD (Total Harmonic Distortion) and noise.
Sometimes refereed to as spectral "cleanness".

Also the stability of the sine wave in frequency over time and temperature and it's amplitude stability should be defined.

In short,
You need to define the following:
1. The frequency range .
2. The "purity"
3. The stability.

All the above have an influence on the method that can be used to implement the sine wave generator and it's complexity .
 
Last edited:
For my opinion, the problem is that nobody from us (who have answered up to now) knows what the questioner needs. Unfortunately he does not tell us if he is interested in a sinewave output only or if he wants a signal generator for different waveforms (triangle, squarewave, sinus).
Of course, in case he needs only a sinusoidal output, it is not the best idea to start with a squarewave.
There are many versatile harmonic oscillator topologies - single- or dual-element tunable.
The most important parameters for finding a suitable topology are:
* Frequency of oscillation,
* Tunability (single or dual element)
* Amplitude (value, constant or selectable)
* Quality (THD).
 
I like LC oscillators, and they generate "pretty good" sine waves, but the microprocessor/DAC look-up table (LUT) approach is simple
Really? Got got got to disagree on this one.

I don't think a microcontroller development system, language compiler, device programmer, and 100 lines of code are "simple" in any situation, let alone when compared to 1 transistor and a few passives.

ak
 
AK -

And I have to disagree with you. It depends on the requirements. If you want a good sine wave adjustable over several decades you can do that with a uP and DAC but not with your one transistor circuit. I could pull parts out of my cabinet an make a uP based one that handles 20 - 20000 Hz before the day is over (okay, I happen to have a dsPIC with built in audio DAC that oversamples by 256x, and most hobbyists would not have this part in stock.)

Bob
 

hevans1944

Hop - AC8NS
Where in that reference did you find this statement? ...
It's there. Here is the quote: "Further more, when the input is triangular, the output waveform is also sinusoidal. This then forms the basis of a Active Low Pass Filter ..." And of course it isn't true. The OP has taken misinformation and now wonders why his simulation doesn't produce sine waves.

For my opinion, the problem is that nobody from us (who have answered up to now) knows what the questioner needs.
Absolutely correct.

I don't think a microcontroller development system, language compiler, device programmer, and 100 lines of code are "simple" in any situation, let alone when compared to 1 transistor and a few passives.
Simple is relative to your level of education and experience. I think it is simple to use a microprocessor because I am already familiar with some of them, have the requisite hardware and software development environment, and have a few μPs on hand to play with. I also have thousands of other components to play with, but setting up a reliable analog oscillator circuit is far more complicated than just picking out a transistor and a few passive components. If I get it wrong initially, there are hours of troubleshooting and tweaking component values ahead. Compare this to modifying a few lines of code. No soldering required. So, I'm with Bob on this one until the frequency gets too high for the microprocessor/DAC approach. After that, well, I guess it's time to find a transistor (or two or three) and round up some passive components. Analog isn't dead, but it's way more complicated than digital, IMHO. YM (or km) MV.
 
Last edited:
I don't think:
I'm pretty new in this
goes well with DSP code.

I have uCs also, use them often, and in fact the majority of the circuits I post are digital rather than analog in nature. I am handicapped in that the OP's image in post #1 won't load, so I'm a bit blind as to what his starting point is, but rarely does new = uC.

ak
 
Top