Note: Your browser may not currently support MathML. See our browser support page for additional details. You can always view the correct math in the PDF version.
In this lab, we examine the representation of periodic signals based on Fourier series. Periodic signals can be represented by a linear combination of an infinite sum of sine waves, as expressed by the trigonometric Fourier series representation.Periodic signals can also be represented by an infinite sum of harmonically related complex exponentials, as expressed by the exponential Fourier series representation. In this lab, we analyze both of these series representations. In particular, we focus on how to compute Fourier series coefficients numerically.
This example helps one to gain an understanding of Fourier series decomposition and reconstruction for periodic signals. The first step involves estimating
| Waveform type | LabVIEW MathScript function |
| Square wave | square(T), T denotes period |
| Triangular wave | sawtooth(T,Width), Width=0.5 |
| Sawtooth wave | sawtooth(T,Width), Width=0 |
| Half wave rectified sine wave |
Use a switch structure to select different types of input waveforms. Set the switch parameter w as the input and connect it to an Enum Control(Controls → Modern → Ring & Enum → Enum). Edit the Enum Control items to include all the waveform types.
Set Amplitude of input (A), Period of input (T) and Number of Fourier coefficients (N) as control parameters. Determine Fourier coefficients
abs. Finally, determine the maximum and average errors by using the functions max and sum. Figure 1 shows the completed block diagram of the Fourier series signal decomposition and reconstruction system.
Display the input signal using a waveform graph. Before displaying the graph, configure it using the function Build Waveform(Functions → Programming → Waveforms → Build Waveforms). Also display the Fourier coefficients, reconstructed signal and error in the waveform graph, and place several numerical indicators to show the values of the Fourier coefficients, maximum error and average error.
Figure 2 and Figure 3 illustrate the front panel of the Fourier series signal decomposition and reconstruction system, respectively. To display all the outputs within a limited screen area, use a Tab Control(Controls → Modern → Containers → Tab Control) in the front panel. Here the outputs are arranged in two different tabs: Fourier Series and Signal Reconstruction.
![]() |
![]() |
![]() |
In this example, let us perform electrical circuit analysis using the trigonometric Fourier series. The ability to decompose any periodic signal into a number of sine waves makes the Fourier series a powerful tool in electrical circuit analysis. The response of a circuit component when a sinusoidal input is applied to its terminals is well-known in circuit analysis. Thus, to obtain the response to any periodic signal, one can decompose the signal into sine waves and perform a linear superposition of the sine waves.
Consider a simple RC circuit excited by a periodic input signal as shown in Figure 4.
![]() |
The block diagram of this linear circuit or system is shown in Figure 5. Determine the Fourier series coefficients of the input voltage signal as discussed in the previous example. Because the Fourier series involves the sum of sinusoids, phasor analysis can be used to obtain the output voltage
Because the sine and cosine components of the input voltage are known, one can easily determine the output by adding the individual output components because the circuit is linear. Determine each output voltage component by using Equation 1.
Figure 6 and Figure 7 show the front panel of this system for its two tabs. The magnitude and phase of the sine and cosine components are shown in the front panel separately. Furthermore, the tab control is used to show the Fourier series and system output separately.
![]() |
![]() |
![]() |
RL Circuit Analysis
Build a hybrid VI to analyze the RL circuit shown in Figure 8 using Fourier series.
![]() |
The input voltage for the circuit is to be either a square wave or a triangular wave with a period T=2 seconds.
Compute and display the following:
Hints:
RMS Value
The RMS value of a periodic function
The RMS value of a waveform consisting of sinusoids with different frequencies is equal to the square root of the sum of the squares of the RMS value of each sinusoid. If a waveform is represented by the following Fourier series
then, the RMS value
Average power
The average power of the Fourier series can be expressed as
Insert Solution Text Here
Doppler Effect
The Doppler effect denotes the change in frequency and wavelength of a wave as perceived by an observer moving relative to the wave source. The Doppler effect can be demonstrated via time scaling of Fourier series. The observer hears the siren of an approaching emergency vehicle with different amplitudes and frequencies as compared to the original signal. As the vehicle passes by, the observer hears another amplitude and frequency. The reason for the amplitude change (increased loudness) is because of the proximity of the vehicle. The closer it is, the louder it gets. The reason for frequency (pitch) change is due to the Doppler effect. As the vehicle approaches, each successive compression of the air caused by the siren occurs a little closer than the last one, and the opposite happens when the vehicle passes by. The result is the scaling of the original signal in the time domain, which changes its frequency. When the vehicle approaches, the scaling factor is greater than 1, resulting in a higher frequency, and, when it passes by, the scaling factor is less than 1, resulting in a lower frequency. More theoretical aspects of this phenomenon are covered in reference (Reference).
Define the original siren signal as
where
where
First, generate a signal and create an upscale and a downscale version of it. Observe the Fourier series for all the signals. Set the amplitude and frequency of the original signal and the scaling factors as controls. In addition, play the sounds using the LabVIEW Play Waveform function. Figure 9 shows a possible front panel for this type of system.
![]() |
Insert Solution Text Here
Synthesis of Electronic Music
In electronic music instruments, sound generation is implemented via synthesis. Different types of synthesis techniques such as additive synthesis, subtractive synthesis and frequency modulation (FM) synthesis are used to create audio waveforms. The simplest type of synthesis is additive synthesis, where a composite waveform is created by summing sine wave components, which is basically the inverse Fourier series operation. However, in practice, to create a music sound with rich harmonics requires adding a large number of sine waves, which makes the approach inefficient computationally. To avoid adding a large number of sine waves, modulation with addition is used. This exercise involves the design of algorithms used in the Yamaha DX7 music synthesizer, which debuted in 1983 as the first commercially available digital synthesizer.
The primary functional circuit in DX7 consists of a digital sine wave oscillator plus a digital envelope generator. Let us use additive synthesis and frequency modulation to achieve synthesis with six configurable operators. When one adds together the output of some operators, an additive synthesis occurs, and when one connects the output of one operator to the input of another operator, a modulation occurs.
In terms of block diagrams, the additive synthesis of a waveform with four operators is illustrated in Figure 10.
![]() |
The output for the combination shown in Figure 10 can be written as
Figure 11 shows the FM synthesis of a waveform with two operators.
![]() |
The output for the combination shown in this figure can be written as
Other than addition and frequency modulation, one can use feedback or self-modulation in DX7, which involves wrapping back and using the output of an operator to modulate the input of the same operator as shown in Figure 12.
![]() |
The corresponding equation is
Different arrangements of operators create different algorithms. Figure 13 displays the diagram of an algorithm.
![]() |
And the output for this algorithm can be written as
With DX7, one can choose from 32 different algorithms. As one moves from algorithm No. 32 to algorithm No. 1, the harmonics complexity increases. In algorithm No. 32, all six operators are combined using additive synthesis with a self modulator generating the smallest number of harmonics. Figure 14 shows the diagram for all 32 combinations of operators. More details on music synthesis and the Yamaha DX7 synthesizer can be found in the (Reference)-(Reference).
Next, explore designing a system with six operators and set their amplitude and frequency as controls. By combining these operators, construct any three algorithms, one from the lower side (for example, algorithm No. 3), one from the middle side (for example, algorithm No. 17) and the final one from the upper side (for example, algorithm No. 30). Observe the output waves in the time and frequency domains (find the corresponding Fourier series).
![]() |
Insert Solution Text Here