Black-box design to create sawtooth waveform

  • Engineering
  • Thread starter peasngravy
  • Start date
  • #1
60
5

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
 

Answers and Replies

  • #2
berkeman
Mentor
58,412
8,485
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 peasngravy
  • #3
60
5
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
 
  • #4
gneill
Mentor
20,875
2,838
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 peasngravy and berkeman
  • #5
60
5
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?
 
  • #6
berkeman
Mentor
58,412
8,485
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!
 
  • #7
berkeman
Mentor
58,412
8,485
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 peasngravy and gneill
  • #8
60
5
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:
  • #9
berkeman
Mentor
58,412
8,485
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...
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...
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?
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 peasngravy
  • #10
60
5
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 berkeman
  • #11
Tom.G
Science Advisor
3,532
2,268
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
60
5
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
gneill
Mentor
20,875
2,838
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
60
5
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
berkeman
Mentor
58,412
8,485
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
berkeman
Mentor
58,412
8,485
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 peasngravy
  • #17
60
5
this is my schematic so far with those gains, but it doesn't have the correct waveform yet

1604068465552.png
 
  • #18
berkeman
Mentor
58,412
8,485
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
60
5
Oops I just checked the TL 081 requirements and it needs a supply of +/-7-36V
 
  • #20
berkeman
Mentor
58,412
8,485
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
60
5
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
berkeman
Mentor
58,412
8,485
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
60
5
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
60
5
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 berkeman

Related Threads on Black-box design to create sawtooth waveform

Replies
6
Views
7K
  • Last Post
Replies
5
Views
2K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
12
Views
2K
  • Last Post
Replies
4
Views
9K
Replies
0
Views
2K
Replies
7
Views
5K
  • Last Post
Replies
6
Views
1K
Top