experiment 5 a fourier series analyzervvakilian/labsece330/labdescriptions/lab 5… · experiment 5...

21
Experiment 5 – A Fourier series analyzer Achievements in this experiment Compose arbitrary periodic signals from a series of sine and cosine waves. Confirm the Fourier Series equation. Compute fourier coefficients of a waveform. Build and use a Fourier Series analyzer. Demonstrate that periodic waveforms can be decomposed as sums of sinusoids. Introduce complex notation. Preliminary discussion In Lab 1 we discovered that sinewaves are special in the context of linear systems (time invariance assumed). Unlike other waveforms, a sinewave input emerges at the output as a sinewave. We saw in Lab 2 that this makes it possible to completely characterize the behaviour of a system in this class by simply measuring the output/input amplitude ratio and the phase shift of the sinewave as a function of frequency. Now, this is fine if we only need to process sinewaves -- is it feasible to make use of this when dealing with other kinds of inputs ? For example, when the input is a waveform like the sequence of digital symbols we investigated in Lab 2. One possibility is to see whether a non-sinusoidal waveform could be expressed as a sum of sinewaves, over a suitable frequency range, either exactly, or even approximately. If this could be done, the system output can then be obtained by exploiting the additivity property of linear systems, i.e., first obtain the output corresponding to each sinusoidal component of the input signal, then take the sum of the outputs. This was covered in Lab 2. In this Lab we explore this idea by means of an ancient technique based on the generation of beat frequencies -- somewhat like when a musician uses a tuning fork. We will begin by adding together many beat frequencies and view the resulting waveform. From there we will look at the equations and use what we know from trigonometry to decompose waveforms into their constituent components. Pre-requisites: Familiarization with the SIGEx conventions and general module usage. A brief review of the trigonometry required will be covered as needed.

Upload: others

Post on 18-Oct-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Experiment 5 A Fourier series analyzervvakilian/LabsECE330/LabDescriptions/Lab 5… · Experiment 5 – A Fourier series analyzer Achievements in this experiment Compose arbitrary

Experiment 5 – A Fourier series analyzer

Achievements in this experiment

Compose arbitrary periodic signals from a series of sine and cosine waves. Confirm the Fourier

Series equation. Compute fourier coefficients of a waveform. Build and use a Fourier Series

analyzer. Demonstrate that periodic waveforms can be decomposed as sums of sinusoids.

Introduce complex notation.

Preliminary discussion

In Lab 1 we discovered that sinewaves are special in the context of linear systems (time

invariance assumed). Unlike other waveforms, a sinewave input emerges at the output as a

sinewave. We saw in Lab 2 that this makes it possible to completely characterize the behaviour

of a system in this class by simply measuring the output/input amplitude ratio and the phase

shift of the sinewave as a function of frequency.

Now, this is fine if we only need to process sinewaves -- is it feasible to make use of this when

dealing with other kinds of inputs ? For example, when the input is a waveform like the

sequence of digital symbols we investigated in Lab 2.

One possibility is to see whether a non-sinusoidal waveform could be expressed as a sum of

sinewaves, over a suitable frequency range, either exactly, or even approximately. If this could

be done, the system output can then be obtained by exploiting the additivity property of linear

systems, i.e., first obtain the output corresponding to each sinusoidal component of the input

signal, then take the sum of the outputs. This was covered in Lab 2.

In this Lab we explore this idea by means of an ancient technique based on the generation of

beat frequencies -- somewhat like when a musician uses a tuning fork. We will begin by adding

together many beat frequencies and view the resulting waveform. From there we will look at the

equations and use what we know from trigonometry to decompose waveforms into their

constituent components.

Pre-requisites:

Familiarization with the SIGEx conventions and general module usage. A brief review of the

trigonometry required will be covered as needed.

Page 2: Experiment 5 A Fourier series analyzervvakilian/LabsECE330/LabDescriptions/Lab 5… · Experiment 5 – A Fourier series analyzer Achievements in this experiment Compose arbitrary

Equipment

• PC with LabVIEW Runtime Engine software appropriate for the version being used.

• NI ELVIS 2 or 2+ and USB cable to suit

• EMONA SIGEx Signal & Systems add-on board

• Assorted patch leads

• Two BNC – 2mm leads

Procedure

Part A – Setting up the NI ELVIS/SIGEx bundle

1. Turn off the NI ELVIS unit and its Prototyping Board switch.

2. Plug the SIGEx board into the NI ELVIS unit.

Note: This may already have been done for you.

3. Connect the NI ELVIS to the PC using the USB cable.

4. Turn on the PC (if not on already) and wait for it to fully boot up (so that it’s ready to

connect to external USB devices).

5. Turn on the NI ELVIS unit but not the Prototyping Board switch yet. You should observe

the USB light turn on (top right corner of ELVIS unit).The PC may make a sound to indicate that

the ELVIS unit has been detected if the speakers are activated.

6. Turn on the NI ELVIS Prototyping Board switch to power the SIGEx board. Check that

all three power LEDs are on. If not call the instructor for assistance.

7. Launch the SIGEx Main VI.

8. When you’re asked to select a device number, enter the number that corresponds with

the NI ELVIS that you’re using.

9. You’re now ready to work with the NI ELVIS/SIGEx bundle.

10. Select the Lab 8 tab on the SIGEx SFP.

Note: To stop the SIGEx VI when you’ve finished the experiment, it’s preferable to use the

STOP button on the SIGEx SFP itself rather than the LabVIEW window STOP button at the

top of the window. This will allow the program to conduct an orderly shutdown and close the

various DAQmx channels it has opened.

Page 3: Experiment 5 A Fourier series analyzervvakilian/LabsECE330/LabDescriptions/Lab 5… · Experiment 5 – A Fourier series analyzer Achievements in this experiment Compose arbitrary

The experiment

Part 1 – Constructing waveforms from sine & cosines

A simple sinusoid with zero phase can be represented by the equation

( ) ( ) (Eqn 1)

And a cosinewave with a frequency of n times can be simply represented by the equation

( ) ( ) (Eqn 2)

Any wave which is an integer multiple of another frequency is known as a harmonic of the

frequency. So equation 2 represents the harmonics of the signal in equation for .

We can use the “harmonic summer” simulation in Experiment TAB 8 to view and sum multiple

signals which are harmonics of the fundamental signal ie: the signal for n=1. Harmonics for which

n is even are known as even harmonics, and when N is odd are called odd harmonics. This

simulation allows us to view and sum any sinusoid for which , that is, the fundamental

and nine harmonics. The numeric entry boxes allow you to enter the amplitude of each sinusoid.

11. Experiment a little by entering various amplitudes into the numeric entry boxes for the

cosine row. Confirm for yourself visually that what is displayed is as you would expect.

12. Set all amplitudes to zero, except for the “1st” component, the fundamental, which you

can set to 1. Moving from the second to the ninth sequentially, set each amplitude to the equal to

1. As you do this notice how the combined signal is changing. Do this for the cosine row ONLY

at this point.

Question 1

How would you expect the summation of to look if you could add up many more harmonics ?

Question 2

What is its peak amplitude and is this as expected ?

Question 3

Is the fundamental an odd or even function ? Is the summation odd or even ?

Page 4: Experiment 5 A Fourier series analyzervvakilian/LabsECE330/LabDescriptions/Lab 5… · Experiment 5 – A Fourier series analyzer Achievements in this experiment Compose arbitrary

Question 4

Write the equation for the summation of the 10 signals ? Is it symmetrical about the X axis?

Question 5

Vary the amplitudes and notice how the signal changes . You may set the amplitude of certain

components to 0 as you see fit. Can you create a wave form which starts at a zero value ?

Write the equation for your new varied amplitude signal ? Does it start at a zero value ?

13. Sketch your arbitrary wave form, for which you have just written the equation, below.

Graph 1: sine wave summation

Page 5: Experiment 5 A Fourier series analyzervvakilian/LabsECE330/LabDescriptions/Lab 5… · Experiment 5 – A Fourier series analyzer Achievements in this experiment Compose arbitrary

The general form of the equation for the summation of cosine harmonics is as follows:

( ) ∑ ( )

where are the amplitude values of each cosine wave.

14. Set all cosinewave amplitudes equal to 0 and now set the sine waveform amplitudes equal

to 1, starting from the first harmonic and moving sequentially until the 10th harmonic. Notice

how the summation changes as you add harmonics.

Question 6

How would you expect the sine summation of to look if you could add up many more harmonics ?

Question 7

What is its peak amplitude and is this as expected ? Is this an odd or even function ?

Question 8

Vary the amplitudes and notice how the signal changes . You may set the amplitude of certain

components to 0 as you see fit. Can you create a wave form which starts at a non-zero value ?

Write the equation for your new varied-amplitude signal ? Does it start at a non-zero value ? Is

it symmetrical about X axis.?

The general form of the equation for the summation of sine wave harmonics is as follows:

( ) ∑ ( )

where are the amplitude values of each sine wave.

The general form for the summation of both sine and cosine harmonics is:

( ) ∑ ( )

∑ ( )

Page 6: Experiment 5 A Fourier series analyzervvakilian/LabsECE330/LabDescriptions/Lab 5… · Experiment 5 – A Fourier series analyzer Achievements in this experiment Compose arbitrary

Even functions are symmetrical about the Y axis.

Odd functions are not symmetrical about the Y axis, but appear to be inverted about the X axis

on the negative side of the Y axis.

Sine and cosine waves, as well as their sums of sine and cosines, are always symmetrical about

the X axis. Being symmetrical means that they cannot represent a DC offset. In order to have a

DC offset we must add a constant to the equation.

15. Add a DC component to the signal by inputting the value into the DC numeric entry box ?

Let us add a value to represent that constant and the general equation for our arbitrary

wave form becomes

( ) ∑ ( )

∑ ( )

where N is max number of harmonics present. In our experiment above, .

This equation describes any arbitrary wave form with the proviso that it is periodic. Any

periodic waveform, no matter how complicated, can be represented by the summation of many

simple sine and cosine waveforms. This equation is known as the Fourier series equation,

naturally enough named after Jean Baptiste Joseph, Baron de Fourier, 1768 – 1830.

Figure 1: Portrait of Joseph Fourier

Let us have a further look at this important equation.

When N equals one, this frequency known as the fundamental frequency, is also called the

resolution frequency. Being the smallest frequency in this series it defines the minimum

separation between components in a particular waveform.

In the Fourier series equation above we have grouped waves in terms of whether they are sine

or cosine waveforms. Let us now modify this equation and group individual components by their

harmonic number. This is easy enough and is as follows

Page 7: Experiment 5 A Fourier series analyzervvakilian/LabsECE330/LabDescriptions/Lab 5… · Experiment 5 – A Fourier series analyzer Achievements in this experiment Compose arbitrary

( ) ∑ ( )

( )

Grouping in this way allows us to think of each frequency as having both a sine and cosine

component.

Let us have a quick revision of what adding a sine and a cosine of the same frequency together

may result in.

16. Using the “harmonics summer” simulation in the Experiment 8 TAB of the SIGEx SFP,

set all amplitudes including that of the DC equal to 0. Set the amplitude of the sine and cosine

first harmonic equal to 1. View the resulting summation.

Question 9

Write the equation for the summation of these 2 waves ? Write the equation for the summation

in terms of the sine wave with a non zero phase shift.

17. Vary the amplitudes from 0 to 1 and notice how the signal changes .

Question 10

Describe how the summation changes as you vary the respective amplitudes?

Question 11

For a particular pair of amplitudes you have set, write the equation for the summation in terms

of sine and cosine as well as its equivalent polar representation ?

Page 8: Experiment 5 A Fourier series analyzervvakilian/LabsECE330/LabDescriptions/Lab 5… · Experiment 5 – A Fourier series analyzer Achievements in this experiment Compose arbitrary

18. Sketch a vector or for phasor representation of these two signals and their resulting

summation, known as the resultant.

Graph 2: components & resultant

For each harmonic, nwt, a signal may have a sine and cosine component, implemented by their

own respective amplitude, an and bn. It is helpful to think about these component pairs as a

single entity at a particular frequency. The only difference between them being their respective

amplitude and the respective orientation or phasing. We know that a sine wave is 90° out of

phase with a cosine wave, a quality which makes those two components orthogonal to each other.

By orthogonal we mean that they operate independently of each other. And so we need a

notation and document these two-dimensional pair of components and this notation is provided

to us by Euler with his famous equation:

Where j the notes the component at 90° out of phase with the other component, hence the sine

and cosine pair.

Page 9: Experiment 5 A Fourier series analyzervvakilian/LabsECE330/LabDescriptions/Lab 5… · Experiment 5 – A Fourier series analyzer Achievements in this experiment Compose arbitrary

Hence we can replace all sine/cosine pairs at a particular harmonic n with the complex

exponential function , and in this way the Fourier series can be rewritten as

( ) ∑

where Cn represents the resultant from the pair of respective amplitudes for the sine and

cosine components. ie: C 2 = b 2

+ a 2, and is known as the “complex fourier series”.

Euler's formula allows us to process the sine/cosine component pair , simultaneously, rather than

individually. It is a form of two-dimensional notation where the sine and cosine components

for a frequency are instead treated together as a resultant with particular phase ie polar

notation. This notation is known as “complex” notation and was introduced in the previous

experiment, Experiment 7.

Remember that the practical part of this experiment just completed above shows us how a

resultant waveform is represented by two orthogonal components.

Part 2 – Computing Fourier coefficients

In the previous part of this experiment we discovered that we can construct any arbitrary

periodic waveform by the summation of a number of sine and cosine harmonics. This knowledge

is the basis of signal synthesis and in this part of the experiment we will do the reverse

process, that is, the analysis of an arbitrary wave form to discover the presence and amplitude

of its constituent harmonics. We call these amplitudes the Fourier coefficients of the waveform

as they are the coefficients within the Fourier series equation we have just derived.

Armed with only some basic trigonometry we will now explore some more qualities of sinusoids.

Before we create our arbitrary wave form to be analysed let us determine some rules with

which we can build our analyzer.

We know that the area under a sine wave or a cosine wave over a timeframe of one period will

always be equal to 0. Consequently we know that the area under a sine wave or cosine wave for a

timeframe of any number of periods will also be equal to 0. To determine the area

mathematically we would integrate over the timeframe of interest. This process would give us

the average value of the signal during that time. This average value is the DC component of the

signal.

Figure 2: model for integrating one period of a sinusoid

n n n

Page 10: Experiment 5 A Fourier series analyzervvakilian/LabsECE330/LabDescriptions/Lab 5… · Experiment 5 – A Fourier series analyzer Achievements in this experiment Compose arbitrary

The INTEGRATE & DUMP module can be used to integrate over a single period as denoted by

the input clock. This is well suited to integrating periodic waveforms such as sinusoids and

products thereof.

In this next exercise we will integrate a sinusoid over a single period to prove the assertion that

the area under a sine wave or a cosine wave over a timeframe of one period will always be equal to

0.

19. Connect the model as per Figure 2 above. The clock connection is necessary for this

module, unlike for the continuous time INTEGRATORS on the SIGEx board.

Settings are as follow:

SCOPE: Timebase: 4ms; Trigger on Ch0; Connect Ch0 to CLK input; Level=1V

FUNCTION GENERATOR: Select SINE output, AMPLITUDE = 4vpp, FREQUENCY=1kHz

Refer to the SIGEx User Manual for instructions on how the I&D and I&H functions work if

this is not obvious. NOTE: The I & D period is from positive clock edge to positive clock edge.

Question 12

What is the output value at the end of the integration period ? HINT: the I&H function will

hold the final value.

20. While viewing the I&D output, to broaden your understanding of the integration process,

change the incoming signal from sine to triangle to bipolar squarewave at the FUNCTION

GENERATOR VI and confirm that the integrated output is as you would expect over one period.

You should be able to confirm that integration is the accumulation of the total signal charge,

with positive signals adding to the total, and negative signals subtracting from the total.

DC extraction using LPF

Another way of extracting the DC component of a signal is by using a filter which is tuned to a

sufficiently low-frequency to exclude all harmonics except for the DC component. The

integration process you have just explored is also a form of filtering, (as discussed in

Experiment 6 on matched filtering.) We will use the filtering method next.

Note that in this next part of the experiment the signals we are using are generated from data

arrays in LabVIEW and output in a synchronized manner from the ANALOG OUT terminals

DAC-0 and DAC-1.These signals are thus synchronized to each other, just as they appear on

screen and in the textbook.

21. Using the left hand side of Experiment 8 TAB of the SIGEx SFP, select a sine wave , 1st

harmonic. Connect DAC-1 to the input of the TUNEABLE LPF and view both input and output

with the scope.

Settings are as follow:

SCOPE: Timebase 4ms; Rising edge trigger on CH0; Trigger level=0V

TUNEABLE LPF: GAIN=mid position

Page 11: Experiment 5 A Fourier series analyzervvakilian/LabsECE330/LabDescriptions/Lab 5… · Experiment 5 – A Fourier series analyzer Achievements in this experiment Compose arbitrary

Adjust the frequency control, fc, of the TLPF from fully clockwise moving counterclockwise

until the output signal is a DC value of approximately 0 V.

Try this test for several harmonics. Change the “sine harmonic” value to 2,3 or 5 etc to try this.

INSIGHT 1: average value of an integral number of periods of sine or cosine waves equals zero.

Note that as far as the filter is concerned a single cosine wave is the same as a sine wave, so

Insight 1 holds true for both. You can vary the phase of the sinewave out of DAC-1 using the

“sine phase” control. The signal out of DAC-0 remains constant as a cosine wave.

22. Set the “sine harmonic “ value back to 1. Set “sine phase” to 0. View DAC-1 with CH1

and DAC-0 with CH0.

Settings as follows:

SCOPE: Timebase 4ms; Rising edge trigger on CH0; Trigger level=0V

DAC-1 will be a sine wave and DAC-0 a cosine wave, relative to each other.

Connect as shown in the figure below. View the output of the MULTIPLIER as well as the output

of the TUNEABLE LOW PASS FILTER.

Figure 3: comparing sinusoids

You will now multiply a sine wave by a cosine wave and determine its average value.

Repeat this with the second and third harmonic of the sinusoid.

Question 13

What is the average value of these three products ?

INSIGHT 2: average value of an integral number of products of any sine or cosine harmonics

equals zero.

Page 12: Experiment 5 A Fourier series analyzervvakilian/LabsECE330/LabDescriptions/Lab 5… · Experiment 5 – A Fourier series analyzer Achievements in this experiment Compose arbitrary

23. Set the “sine harmonic “ value back to 1. Set “sine phase” to 90. View DAC-1 with CH1

and DAC-0 with CH0.

Settings as follows:

SCOPE: Timebase 20ms; Rising edge trigger on CH0; Trigger level=1V

DAC-1 will now be a cosine wave and so will be DAC-0.

NB: This is relative to the start of the signal data array. See the ANALOG OUT VIEWER

window for confirmation.

Connect as shown in the figure above.

View the output of the MULTIPLIER as well as the output of the TUNEABLE LOW PASS

FILTER with the scope.

You will now multiply a cosine wave by itself and determine its average value.

Question 14

What is the average value of the product of a cosine by itself ?

INSIGHT 3: average value of an integral number of products of any sine by its harmonic equals

zero.

INSIGHT 4: average value of an integral number of products of any sine by itself equals a non

zero value.The same holds for cosine.

Question 15

Write the complete formula for the product of a cosine, Acoswt, by itself? What do the terms

represent?

At this point we can see that the only product to yield a non-zero average value is that of a sine

wave by the same sine wave. The same is true for cosine. So if we multiply an arbitrary

waveform by a particular “probing” sine or cosine harmonic and extract the average value of this

product there will only be non-zero when that arbitrary wave form contains that particular

“probing” harmonic as one of its constituent components. This is a very powerful insight and

allows us to have a simple tool with which to analyse arbitrary wave forms.

Let us now give this a try.

24. Construct the following arbitrary wave form using the HARMONIC SUMMER on the

right hand side of the SIGEx SFP, Experiment 8 TAB.

Settings are as follows :

Cosine amplitudes: 1, 0, 0.5,0,0,1,0,0,0,0

Sine amplitudes: 0,0.3,1,0,0,0,2,0,0,0

DC level: 0.5

Page 13: Experiment 5 A Fourier series analyzervvakilian/LabsECE330/LabDescriptions/Lab 5… · Experiment 5 – A Fourier series analyzer Achievements in this experiment Compose arbitrary

Switch “to DAC-0” ON: This will output the summation to DAC-0. See the ANALOG VIEWER

window.

Set “sine harmonic” =1; Set “sine phase = 0. This signal is output to DAC-1.

SCOPE: Timebase 4ms; Rising edge trigger on CH0; Trigger level=0V

Figure 4: comparing sinusoids

25. You will need to now ensure that the overall gain of the MULTIPLIER and TLPF is unity.

We know from the User Manual specifications that the MULTIPLIER gain is approximately

unity, whereas the TLPF GAIN is variable. Connect both MULTIPLIER inputs to the same 1st

harmonic sinewave and view the output. While viewing the TLPF output, turn the fc control

clockwise to pass the entire signal. Adjust the TLPF gain precisely for a 4Vpp output, so as to

have unity gain throughout the “analyzer” path.

26. Return to your previous setup but do not touch the TLPF GAIN setting for the rest of

the experiment. At this point we are multiplying the arbitrary wave form which investigated by

a first harmonic sine wave.

Figure 5: example of SIGEx SFP Tab “Lab 8” including

harmonic generator bottom left, and summer on the right

Page 14: Experiment 5 A Fourier series analyzervvakilian/LabsECE330/LabDescriptions/Lab 5… · Experiment 5 – A Fourier series analyzer Achievements in this experiment Compose arbitrary

27. View the product at the output of the multiplier on CH0 and the TLPF output. Adjust the

TLPF frequency control to isolate the DC component. Note the value of the DC level as the

amplitude of the first harmonic sinusoid in the table below. Increase harmonics one by one,

adjust theTLPF frequency setting if necessary and note the amplitude for the remaining 10 sine

harmonics in table.

Now to analyze for the cosine components.

28. Set “sine harmonic” back to 1. Change “sine phase” to 90. This will convert the sine wave

into a cosine wave , as sin(wt + 90) = cos(wt). Repeat the above steps to all 10 cosines and enter

your measurements of the TLPF DC output level into the table .

Harmonic

number

sine

(V)

cosine

(V)

1st

2nd

3rd

4th

5th

6th

7th

8th

9th

10th

DC (V) =

Table of measured coefficients

29. Connect the input of the TLPF directly to the arbitrary wave form at DAC-0 to measure

the DC value of that waveform alone, and enter into the table at “DC (V) = “.

Question 16

How do your readings compare with expectations ? . Explain any discrepancies .

Page 15: Experiment 5 A Fourier series analyzervvakilian/LabsECE330/LabDescriptions/Lab 5… · Experiment 5 – A Fourier series analyzer Achievements in this experiment Compose arbitrary

30. While you have the experiment setup, vary the harmonic summer settings and see the

resulting output from the TLPF. Experiment a little with values while you have the system setup

and ready.

Page 16: Experiment 5 A Fourier series analyzervvakilian/LabsECE330/LabDescriptions/Lab 5… · Experiment 5 – A Fourier series analyzer Achievements in this experiment Compose arbitrary

Part 3 – Build a manually swept spectrum analyzer

In the previous part of this experiment we use synchronised signals which were generated in

LabVIEW and output via the DACs of the ANALOG OUT module. In this part of the experiment

we will analyse the constructed arbitrary signal using an independent sinusoid generator, that is,

the FUNCTION GENERATOR.

Figure 6:building a “wave analyzer”

31. Once again construct the following arbitrary waveform using the HARMONIC SUMMER

of the SFP, Experiment 8 TAB. Launch the FUNCTION GENERATOR as well.

Settings are same as above, and are as follows :

Cosine amplitudes: 1, 0, 0.5,0,0,1,0,0,0,0

Sine amplitudes: 0,0.3,1,0,0,0,2,0,0,0

DC level: 0.5

Switch “to DAC-0” ON

SCOPE: Timebase 20ms; Rising edge trigger on CH0; Trigger level=0V

FUNCTION GENERATOR: Frequency=1000Hz, Amplitude=4Vpp, Sine wave selected

32. Move the input to the multiplier which was connected to DAC-1 to the FUNC OUT

terminal of the FUNCTION GENERATOR . This signal will be a 4Vpp sine wave at 1000 Hz. View

both inputs to the multiplier on the scope. One is the arbitrary waveform, the other is the 1000

Hz sine wave.

Question 17

What do you notice about their phase relationship ? Is this to be expected ? Explain.

If the inputs are drifting relative to each other then you would expect the product of the

inputs to also be slowly varying.

33. View the sinusoid and the product, output of the multiplier, at the same time and

confirm that it is slowly varying. Trigger the SCOPE on the sinusoid to get a more stable display.

As it varies it will pass through the point of interest, the interface point that we wish to

measure. This point occurs twice per cycle lasts creating both are maxima and minima. If we

detect either the maximum of the minima the absolute value of these will give us the average

DC value which we require.

Page 17: Experiment 5 A Fourier series analyzervvakilian/LabsECE330/LabDescriptions/Lab 5… · Experiment 5 – A Fourier series analyzer Achievements in this experiment Compose arbitrary

You may wish to review your understanding of why these maximas and minimas occur when

signals drift relative to each other. You can use both trigonometry and/or the DAC outputs and

the MULTIPLIER module to revisit this topic.

34. Now view both the output from the FUNCTION GENERATOR and the output of the

TLPF. Adjust the frequency of the TLPF to isolate only the DC component and confirm that it

has a maxima and a minima. HINT: if the DC value is varying too slowly, or you are impatient, or

just inquisitive (…a good thing), increase the frequency at the function generator by 1 Hz. This

will make your DC value vary at a rate of approximately 1 Hz (…much easier to view).

Trigger on the sinewave from the FUNCTION GENERATOR for a stable display.

HINT: use Y-AUTOSCALE ON/OFF to center the display

35. Vary the frequency of the function generator in steps of 1000 Hz starting from 1000

Hz up to 7000 Hz. Note the maximum value of the DC output in the table below. It will be more

accurate to measure peak to peak and then halve it.These will be the measured amplitudes of

the constituent harmonics making out the arbitrary wave form. How do they compare with the

actual amplitude value entered into the SFP itself.?

HINT: to vary the FUNCTION GENERATOR Frequency, place the cursor alongside the digit to

be varied and then use the UP and DOWN keyboard arrows to vary the digit value.

Input

frequency (Hz)

TLPF output

pp swing (V)

Half of

pp (V)

Entered

values

Calculated

resultant (V)

1000

2000

3000

4000

5000

6000

7000

DC (V) =

Table of measured coefficients

Page 18: Experiment 5 A Fourier series analyzervvakilian/LabsECE330/LabDescriptions/Lab 5… · Experiment 5 – A Fourier series analyzer Achievements in this experiment Compose arbitrary

Question 18

Can you explain if your readings differ in some places from the actual value ?

HINT: you have one value per harmonic instead of two. Consider the previous discussion above

about resultants in your answer. And allow for MULTIPLIER and TLPF gains (although you should

have set the overall gain to unity in an earlier part of the experiment).

Whilst the theoretical modeling with the synchronized sine and cosine waves from the previous

part is able to yield the constituent sine and cosine components, a real world signal without the

benefit of synchronization can only measure the resultant amplitude. This is shown in the

exercise just completed.

36. This section of the experiment was about building a manually swept spectrum analyzer.

The function generator instrument has the ability to be automatically swept. As an exercise in

automation enter an appropriate start, stop frequency, say 1001 & 10001 Hz, as well as step size

of 1000 Hz and a step interval of 2 seconds and allow the function generator itself to sweep the

analysing frequency while you view the amplitude of the DC value from the analyzer which

corresponds to the amplitude of each harmonic present. Display the FUNCTION GENERATOR

sinewave also, and trigger the scope on it for a stable display of 4Vpp. Set the AUTOSCALE to

OFF.

Congratulations, you have just constructed a swept spectrum analyzer using basic mathematical

blocks.

Page 19: Experiment 5 A Fourier series analyzervvakilian/LabsECE330/LabDescriptions/Lab 5… · Experiment 5 – A Fourier series analyzer Achievements in this experiment Compose arbitrary

Part 4 – analyzing a square wave

We will now use our manually swept spectrum analyzer to investigate which harmonics at present

in a square wave. The experiment set up is as for the previous section except that now the input

is taken from the PULSE GENERATOR module output.

Figure 7: working with a square wave

37. Vary the patching as shown in figure 7 above

.

Settings are as follows:

FUNCTION GENERATOR: Frequency=1000Hz, Amplitude=2Vpp, Sine wave selected

PULSE GENERATOR: FREQUENCY=1000Hz, DUTY CYCLE=0.5 (50%)

SCOPE: Timebase 4ms; Rising edge trigger on CH1; Trigger level=0V

38. Vary the frequency of the function generator in steps of 1000 Hz starting from 1000

Hz up to 7000 Hz. (Remember, you can vary the input frequency by 1 or 2 Hz to speed up the

resultant DC oscillation display).Note also the maximum value of the DC output in the table

below. These will be the amplitudes of the constituent harmonics making up the squarewave. You

may know from theory that a square wave of 50% duty cycle contains only odd harmonics. This

can help you focus your investigation around the appropriate frequencies.

Page 20: Experiment 5 A Fourier series analyzervvakilian/LabsECE330/LabDescriptions/Lab 5… · Experiment 5 – A Fourier series analyzer Achievements in this experiment Compose arbitrary

Input

frequency (Hz)

TLPF output

amplitude (V)

Scaled measured values

(V)

Calculated

resultant (V)

1000

2000

3000

4000

5000

6000

7000

DC (V) =

Table of measured coefficients for squarewave

Question 19

Why are some of the harmonics hard to detect ?

Varying the duty cycle of the PULSE GENERATOR from the SFP control “DUTY CYCLE”, for

example to 0.2 (20%) will introduce even harmonics.

Question 20

Can you now detect even harmonics in the squarewave of 20% duty cycle ?

View the output from the MULTIPLIER to see what signal you are measuring and extracting the

DC value from.

Page 21: Experiment 5 A Fourier series analyzervvakilian/LabsECE330/LabDescriptions/Lab 5… · Experiment 5 – A Fourier series analyzer Achievements in this experiment Compose arbitrary

Comparing measured Fourier series coefficients to theory

From the theory the relative value of the Fourier series coefficients for a 50:50 square wave

is a series like so:

1, 1/3, 1/5, 1/7….1/n where n is the odd harmonic present in the squarewave.

Question 21

Compare your measured coefficients for the first 4 odd harmonics as ratios to that expected

by theory ? Remember to normalize the measurements for the comparison.

References

Langton.C.,”Fourier analysis made easy ”, www.complextoreal.com