Black-box design to create sawtooth waveform

  • Context: Engineering 
  • Thread starter Thread starter peasngravy
  • Start date Start date
  • Tags Tags
    Design Waveform
Click For Summary
SUMMARY

The discussion focuses on synthesizing a sawtooth waveform using the Fourier series algorithm, specifically with an amplitude of 5 volts and a frequency of 1000 Hz. Participants emphasize the importance of using a summing amplifier circuit to combine sinusoidal inputs scaled according to their Fourier coefficients. Key equations discussed include v(t) = (2/π) * sin(ωt), where ω is derived from the frequency. The conversation also highlights the need for proper op-amp configurations and power supply considerations for accurate waveform generation.

PREREQUISITES
  • Understanding of Fourier series and its application in waveform synthesis
  • Knowledge of operational amplifier (op-amp) circuit design, particularly summing amplifiers
  • Familiarity with AC signal generation and scaling techniques
  • Basic principles of analog electronics, including voltage gain calculations
NEXT STEPS
  • Research the design and implementation of summing amplifiers using op-amps
  • Study the Fourier series expansion for different waveforms, particularly sawtooth and square waves
  • Learn about simulation tools like SPICE for testing circuit designs
  • Explore the effects of gain and offset in op-amp circuits for waveform shaping
USEFUL FOR

Electronics students, circuit designers, and engineers involved in waveform synthesis and analog signal processing will benefit from this discussion.

peasngravy
Messages
72
Reaction score
6
Homework Statement
FIGURE 2(a) shows a ‘black box’ that is to partially synthesise a ‘sawtooth’ waveform of FIGURE 2(b) by using the Fourier series
algorithm:
Relevant Equations
v(t) = 2/pi(sin.omega.t)
Hi

I received some great help yesterday and i was hoping someone would be able to help me out again today

Note: the given equation is very long and would look very messy without being typed in the correct format so I didn't enter the entire thing in the relevant equations box; instead it is included in the screenshot below

1603982937839.png

I am not sure at all what is being asked of me here. There are no Fourier algorithms in any of my notes so I am struggling with what I can do with this.

What I know so far is that the amplitude is 5 volts, and the frequency is 1000hz (1 cycle per ms on the graph).

Could someone please explain how I should use the Fourier algorithm to find my answer?

Thanks
 
Physics news on Phys.org
peasngravy said:
Homework Statement:: FIGURE 2(a) shows a ‘black box’ that is to partially synthesise a ‘sawtooth’ waveform of FIGURE 2(b) by using the Fourier series
algorithm:
Relevant Equations:: v(t) = 2/pi(sin.omega.t)

Hi

I received some great help yesterday and i was hoping someone would be able to help me out again today

Note: the given equation is very long and would look very messy without being typed in the correct format so I didn't enter the entire thing in the relevant equations box; instead it is included in the screenshot below

View attachment 271794

I am not sure at all what is being asked of me here. There are no Fourier algorithms in any of my notes so I am struggling with what I can do with this.

What I know so far is that the amplitude is 5 volts, and the frequency is 1000hz (1 cycle per ms on the graph).

Could someone please explain how I should use the Fourier algorithm to find my answer?

Thanks
Yoiks! My first inclination would be to use an "integrate and dump" circuit; I'm not sure what they want you to do with the FS approximation and opamps. Are you allowed to use transistors too, or just opamps and passive components?
 
  • Like
Likes   Reactions: peasngravy
It doesn't really state either way but I would suspect just passives and opamps. It really does seem a few levels above the rest of the questions
 
Step back a bit and take a broader look at it.
1603991855684.png

The sine functions are already given as inputs to the box. The "formula" is a weighted sum of them...
 
  • Like
Likes   Reactions: peasngravy and berkeman
So the formulas then become
5sin(1000*t)
5sin(2*1000*t) and so on?

t is obviously time, but what time do I need to use for these figures?
 
gneill said:
Step back a bit and take a broader look at it.
View attachment 271811
The sine functions are already given as inputs to the box. The "formula" is a weighted sum of them...
Oh jeeze, I missed that. Thanks!
 
peasngravy said:
So the formulas then become
5sin(1000*t)
5sin(2*1000*t) and so on?

t is obviously time, but what time do I need to use for these figures?
As gneill says, you are provided the sinusoidal signals as inputs. It looks like you just need to scale each input appropriately and combine them... Can you say what kinds of opamp circuits would be used for each of those functions? And are there ways to simplify it down to just a few or one opamp?
 
  • Like
Likes   Reactions: peasngravy and gneill
berkeman said:
As gneill says, you are provided the sinusoidal signals as inputs. It looks like you just need to scale each input appropriately and combine them... Can you say what kinds of opamp circuits would be used for each of those functions? And are there ways to simplify it down to just a few or one opamp?

I think it will just be a very basic summing amplifier

I did find this page which looks like it may be of some help for the circuit http://www.ecircuitcenter.com/Circuits/opsum/opsum2.htm

But I don't even know where to begin with those sinusoidal signals as an input - could you give me a couple of pointers on what I should do there?

It's the time part I am unsure about. How do I know what value of time to put into the equation? Do I just pick the time it takes for one cycle, i.e. 0.001 seconds?
 
Last edited:
peasngravy said:
I think it will just be a very basic summing amplifier
That sounds right, but I'd like to see your attempt at including the scaling in that summing amplifier...
peasngravy said:
I did find this page which looks like it may be of some help for the circuit http://www.ecircuitcenter.com/Circuits/opsum/opsum2.htm
That's close, but it's an inverting topology summing amplifier. You can look for a non-inverting version or follow that one with a unity-gain inverting opamp stage...
peasngravy said:
It's the time part I am unsure about. How do I know what value of time to put into the equation? Do I just pick the time it takes for one cycle, i.e. 0.001 seconds?
peasngravy said:
What I know so far is that the amplitude is 5 volts, and the frequency is 1000hz
To draw the opamp circuit, you don't need to worry about that. I'm guessing you are asking about the simulation part of the question. To be honest, I don't know offhand if you want ##\frac{\omega}{2\pi}## to be the 1kHz frequency or if you want twice or half of that. It's easy to just try the different values in your simulation to verify which choice gives you the right waveform.

(You could also look up the Fourier Series expansion of that waveform to see what value of ##\omega## then are using. I'm too lazy to do that right now...) :smile:
 
  • Like
Likes   Reactions: peasngravy
  • #10
I was asking about those as I thought I may need that to work out the input voltages at each resistor at the input. I suppose I could go for 1v and see what happens

I am going to give this a go tomorrow in that case, as it's getting late here. I will start off with a 4 resistors, 1k, 2k, 3k and 4k and use a bit of trial and error from there. I will keep reporting back as no doubt I will get stuck again... :)
 
  • Like
Likes   Reactions: berkeman
  • #11
t is obviously time, but what time do I need to use for these figures?

Since analog devices are continuous-time devices (within their bandwidth), you don't need to worry about the "t" in the Fourier representation, it disappears; i.e. it becomes an infinite sum of infinitesimals, which ends up being unity here.
 
  • #12
I am having a go at this now without too much luck.

I tried calculating 4voltage inputs, with the equations 5sin(1000), 5sin(1000*2), 5sin(1000*3) and 5sin(1000*4) as I didn't really know what else to do. I made each of these signals 1000, 2000, 3000 and 4000hz
 
  • #13
Don't worry about specific input voltage values for a particular instant in time. The black box circuit won't contain any time-dependent components like capacitors or inductors. It's simply a summing circuit. You just want to have the summing inputs have the appropriate weights (gains).

The time-dependent part comes when you simulate the system with Spice. It provides built-in voltage sources where you can simply supply the required voltage and frequency, and everything is then handled for you.
 
  • #14
So where I've got to is this:

As there are 4 inputs then ωt, time interval, is 0.25ms

So
5sin(ωt) = 5sin^-1 (0.25) = 1.25v, 14.5°
5sin(2ωt) = 5sin^-1 (2*0.25) = 2.5v, 30°
5sin(3ωt) = 5sin^-1 (3*0.25) = 3.75v, 48.6°
5sin(4ωt) = 5sin^-1 (4*0.25) = 5v, 90°

Gain = Vout/Vin = Rf/Rin

Gain of 1st input = 5/1.25 = 4 = rf/rin
If i make Rf 10k, then Rin = 10k/4 = 2.5k

And follow this on for the rest of the inputs - am i on the right track?

PS - is there a way to type equations so they appear correctly as fractions?
 
  • #15
peasngravy said:
PS - is there a way to type equations so they appear correctly as fractions?
Yes. Click on the "LaTeX Guide" link below the Edit window to see how to type equations here.

You can also click Reply on my post to see how I wrote this fraction:

Gain of 1st input = ## \frac{5}{1.25} = 4 = \frac{r_f}{r_{in}}##

(or on a separate line): $$ \frac{5}{1.25} = 4 = \frac{r_f}{r_{in}}$$
 
  • #16
peasngravy said:
So
5sin(ωt) = 5sin^-1 (0.25) = 1.25v, 14.5°
5sin(2ωt) = 5sin^-1 (2*0.25) = 2.5v, 30°
5sin(3ωt) = 5sin^-1 (3*0.25) = 3.75v, 48.6°
5sin(4ωt) = 5sin^-1 (4*0.25) = 5v, 90°
I don't think you need that for anything. Can you show us the opamp schematic with the resistors labeled? Have you started drawing your simulation circuit yet?
 
  • Like
Likes   Reactions: peasngravy
  • #17
this is my schematic so far with those gains, but it doesn't have the correct waveform yet

1604068465552.png
 
  • #18
peasngravy said:
this is my schematic so far with those gains, but it doesn't have the correct waveform yet

View attachment 271849
The input voltages should all have an amplitude of 5V, since those are the inputs to your block. And this is still an inverting topology, so to get the correct waveform you will need to invert the output (and maybe add an offset?)... Oh, and you will need wider power supply rails than just +/-5V, especially with a TL081 opamp -- Can you say why? :smile:

1604068690919.png
 
  • #19
Oops I just checked the TL 081 requirements and it needs a supply of +/-7-36V
 
  • #20
peasngravy said:
Oops I just checked the TL 081 requirements and it needs a supply of +/-7-36V
Yeah, it's definitely not a rail-to-rail opamp, but it should be fine for this simulation. I'd just set its rails to +/-15V to give plenty of headroom.
 
  • #21
I changed this now - I am just learning about op-amps now so I will make many more of these silly mistakes, unfortunately!

I changed that, and flipped the op-amp around, but I get nothing like what I am looking for. I added a dc offset at the inverting terminal.

I feel like I am way out of my depth with this right now :(
 
  • #22
peasngravy said:
I changed that, and flipped the op-amp around, but I get nothing like what I am looking for. I added a dc offset at the inverting terminal.
Can you post your updated schematic? And be careful -- the gain of a non-inverting summing stage is different from that of an inverting stage...
 
  • #23
Offset is set to -6 right now but I've just been messing around with different values for it for now

just editing to add - op amp rail supply is now +- 15, i just forgot to change the name of the terminals
 
Last edited:
  • #24
I just want to say i appreciate all the help you have given me so far. The theory side of this stuff is all new to me
 
  • Like
Likes   Reactions: berkeman
  • #26
So if i want the sum of the 4 inputs to be 5v, with a 5 volt input to each one, I would need them all to have a gain of -4 right, giving 4 inputs of 1.25V making a total Vin of 5v?

So a feedback resistor of 10k, with each input resistor being 2.5k, this would give me a gain of -4?

As Gain = Vin/Vout = -(Rf/Rin)
 
  • #27
peasngravy said:
So if i want the sum of the 4 inputs to be 5v, with a 5 volt input to each one, I would need them all to have a gain of -4 right, giving 4 inputs of 1.25V making a total Vin of 5v?

So a feedback resistor of 10k, with each input resistor being 2.5k, this would give me a gain of -4?

As Gain = Vin/Vout = -(Rf/Rin)
The gains for each component (sin waves of different frequencies) are given in your first post as the Fourier Series coefficients...

1604076029855.png
 
  • #28
I see - so those 4 voltages I calculated from the sin functions earlier should be how I calculate the gains i need?

i.e. 5/1.25
5/2.5
5/3.75
and 5/5 ?
 
  • #29
peasngravy said:
I see - so those 4 voltages I calculated from the sin functions earlier should be how I calculate the gains i need?

i.e. 5/1.25
5/2.5
5/3.75
and 5/5 ?
Something like that. Once you get the sawtooth waveform, you can fine tune the coefficients to get the 2.5V peak amplitude (plus remember to include the 2.5V constant offset term, both in the FW (which they omitted in the problem statement) and in your opamp circuit).
 

Attachments

  • 1604076660788.png
    1604076660788.png
    15.6 KB · Views: 188
  • #30
These need to be AC supplies with set frequencies right? otherwise i'll never get a waveform
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 15 ·
Replies
15
Views
6K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
6K