Connexions

You are here: Home » Content » Lab 5: CTFT and Its Applications

Recently Viewed

This feature requires Javascript to be enabled.

Lab 5: CTFT and Its Applications

Properties of CTFT

The example covered in this section provides an implementation of CTFT and its properties. As mentioned earlier, programming environments can generate and work with only discrete values arranged in arrays. Thus, to get a continuous-time representation of a signal, use a very small value of time increment dt. For example, dt=0.001 means there are 1000 discrete samples in 1 second, which provides a good approximation to represent a low-frequency signal. However, when working with very high-frequency signals, one should decrease the value of dt further to ensure there are enough samples to represent the signal in a continuous fashion over a specified duration.

Figure 1 shows the example of the completed block diagram for the CTFT (or FT) and its properties. This particular VI is capable of finding the FT of a rectangular and a triangular pulse. Create two input signals using the LabVIEW MathScript functions ones and zeros, which are combined in the time domain. Use a case structure to select the combination method (linear combination, convolution or multiplication) and the parameter mode1 to serve as an input that is connected to an Enum Control(Controls ModernRing & Enum Enum). Use parameters mode3 and mode4, which are connected to two Enum controls, to select the input signal type. Also set Pulse width, Time shift and Time scale as control parameters. Pulse width controls the number of ones in the pulse, which is used to increase or decrease the pulse width. Time shift adds zeros before the pulse to provide a time delay. Time scale is set to be multiplied with the time increment (dt) to ensure appropriate scaling of the pulse. Use the LabVIEW MathScript function fft to determine the FT of the continuous signal. Combine the signals in the frequency domain and control the combination method (linear combination, convolution or multiplication) via the parameter mode2. Compute the FT of the time domain combinations and the inverse FT of the frequency domain combinations using the functions fft and ifft. To shift the zero-frequency component to the center of the spectrum, use the LabVIEW MathScript function fftshift. Finally, determine the magnitude and phase of the FT using the functions abs and angle, respectively. Display the input signals and their combinations using a Build Waveform function (Functions → Programming Waveforms Build Waveforms) and a Waveform Graph(Controls Modern Graph Waveform Graph). Also, display the spectrum magnitude and phase using a waveform graph.

Figure 2 and Figure 3 shows the front panel of the above system. Use controls named Pulse width, Time shift and Time scaling to change the waveforms in the time domain. Three waveform graphs for Input signal, Magnitude of FT and Phase of FT also appear in the front panel shown. With the specified front panel controls, one can easily verify CTFT properties. To begin with, run the program in continuous mode using the Run Continuously button.

Varying Pulse Width

Keep the default values of Time shift (=0) and Time scaling (=1) and vary the Pulse width of the rectangular pulse. First, set the value of the Pulse width to its minimum value (=0.01) and then increase it. Observe that increasing the Pulse width in the time domain decrements the width in the frequency domain (see Figure 4 ). When the Pulse width is set to its maximum value (=1) in the frequency domain, only one value can be seen at the center frequency indicating the signal is of DC type (refer to Properties of CTFT section of Chapter 5).

Time Shift

Next, for a fixed pulse width, vary the time shift. Observe that the phase spectrum changes but the magnitude spectrum remains the same. If the signal x ( t ) x ( t ) size 12{x $$t$$ } {} is shifted by a constant t 0 t 0 size 12{t rSub { size 8{0} } } {} , its FT magnitude does not change, but the term ωt 0 ωt 0 size 12{ - ωt rSub { size 8{0} } } {} gets added to its phase angle. This verifies the time-shifting property of FT as stated in Properties of CTFT section of Chapter 5 (see Figure 5).

Time Scaling

Observe that increasing the control Time scaling makes the spectrum wider. This indicates that compressing the signal in the time domain leads to expansion in the frequency domain. This verifies the time-scaling property of FT as stated in Properties of CTFT section of Chapter 5 (see Figure 6).

Linearity

Here, combine two signals to examine the linearity property of FT. Select Linear Combination for the Time domain and Frequency domain combination method. This selection combines two time signals, x1(t)x1(t) size 12{x rSub { size 8{1} } $$t$$ } {}and x2(t)x2(t) size 12{x rSub { size 8{2} } $$t$$ } {}, linearly with the scaling factors, a1a1 size 12{a rSub { size 8{1} } } {}and a2a2 size 12{a rSub { size 8{2} } } {}, producing a new signal, a1x1(t)+a2x2(t)a1x1(t)+a2x2(t) size 12{a rSub { size 8{1} } x rSub { size 8{1} } $$t$$ +a rSub { size 8{2} } x rSub { size 8{2} } $$t$$ } {}. Figure 7 displays the FT of this linear combination. The linear combination in the frequency domain produces a new signal, a1X1(ω)+a2X2(ω)a1X1(ω)+a2X2(ω) size 12{a rSub { size 8{1} } X rSub { size 8{1} } $$ω$$ +a rSub { size 8{2} } X rSub { size 8{2} } $$ω$$ } {}. Figure 7 also displays the inverse FT of this combination. Observe that both combinations produce the same result in the time and frequency domains, as indicated by the linearity property stated in Properties of CTFT section of Chapter 5.

Time Convolution

In this part, convolve two signals in the time domain to examine the time-convolution property of FT. Select Convolution for Time domain and Multiplication for Frequency domain. This selection produces and displays a new signal, x1(t)x2(t)x1(t)x2(t) size 12{x rSub { size 8{1} } $$t$$ * x rSub { size 8{2} } $$t$$ } {}, by convolving the two time signals x1(t)x1(t) size 12{x rSub { size 8{1} } $$t$$ } {}and x2(t)x2(t) size 12{x rSub { size 8{2} } $$t$$ } {}. Multiplication in the frequency domain produces a new signal, X1(ω)X2(ω)X1(ω)X2(ω) size 12{X rSub { size 8{1} } $$ω$$ X rSub { size 8{2} } $$ω$$ } {}. The inverse FT of this multiplied signal is also displayed on the right. Note that both combinations produce the same outcome in the time and frequency domains. This verifies the time-convolution property stated in the Properties of CTFT section of Chapter 5 (see Figure 8).

Frequency Convolution

Convolve two signals in the frequency domain to examine the frequency-convolution property of FT. Select Convolution for Frequency domain and Multiplication for Time domain. This selection convolves the two time signals X1(ω)X1(ω) size 12{X rSub { size 8{1} } $$ω$$ } {}and X2(ω)X2(ω) size 12{X rSub { size 8{2} } $$ω$$ } {} to produce a new signal, X1(ω)X2(ω)X1(ω)X2(ω) size 12{X rSub { size 8{1} } $$ω$$ * X rSub { size 8{2} } $$ω$$ } {}. The inverse FT of the convolved signal is displayed. Multiplication in Time domain produces a new signal, x1(t)x2(t)x1(t)x2(t) size 12{x rSub { size 8{1} } $$t$$ x rSub { size 8{2} } $$t$$ } {}. The FT of this multiplied signal is also displayed. Note that both combinations produce the same outcome in the time and frequency domains. This verifies the frequency-convolution property stated in the Properties of CTFT section of Chapter 5 (see Figure 9).

Noise Reduction

When a signal passes through a channel, it normally gets corrupted by channel noise. Various electronic components used in a transmitter or receiver may also cause additional noise. Noise reduction is an important aspect of any signal processing system. Lab 7 features noise reduction techniques using digital and analog filters. This section presents a simple technique to reduce high-frequency noise.

Figure 10 shows the completed block diagram of a noise reduction system. Consider a speech signal sampled at 8 kHz. Add some high-frequency noise to this signal and then remove the high-frequency components in the frequency domain. Finally, move the signal back into the time domain using the inverse FT. Use the LabVIEW MathScript function wavread to read a wave file specified by the string Path and return the sampled data at a specified sampling rate. A String Control(Controls Modern String & Path String Control) can be added to the input Path to provide the path name for the speech data file. Use two more controls named Time frame width and Frame number to extract a segment of the speech signal before computing Fourier transform. Add together three sine and cosine waves with frequencies of 3.5, 3 and 2.8 kHz to create a high-frequency noise. Then add a scaled version of the noise signal to the signal with the Scaling parameter set as a control. Compute the FT of the Noise added signal using the function fft.

To remove the high-frequency noise components, use a simple lowpass filter by removing the frequency components over a certain threshold (50 percent, for example). After removing the high-frequency components, transform the signal back into the time domain using the function ifft. To get a display of the absolute and centered frequency spectrum, use the functions abs and fftshift. The signals are displayed in the time domain using the functions Build Waveform and Waveform Graph. To be able to hear the speech signals, use the function Play Waveform(Functions Programming Graphics & Sound SoundOutput Play Waveform). Connect the time domain signals to this function via the while loop structure. Connect a Boolean control(Controls Modern Boolean Push Button) to the loop control, which acts as a play switch for the sound signal. The signals are also displayed in the frequency domain using the functions Bundle(Functions Programming Cluster, Class & Variant → Bundle) and XY Graph(Controls Modern Graphs XY Graph).

Figure 11 shows the front panel of the system. Inside the Data File Path control, the location of the speech data file is specified. Three graphs for the Original signal, Noise added signal and Noise reduced signal are shown in both the time and frequency domains. Use the noise level control to allow setting the amount of noise added to the original signal. After running the program, click on the Play button next to each signal. Hear the Original Signal and the Noise added signal. Notice that an unpleasant high-pitched noise gets added to the signal. If the noise level is set more than 0.5, the Original Signal becomes very difficult to hear. Next, hear the Noise reduced signal, which is similar to the Original Signal. The Noise reduced signal is not exactly the same as the Original Signal because some high-frequency components are also removed along with the noise.

Amplitude Modulation

In this section, we examine amplitude modulation and demodulation applications. For transmission purposes, signals are often modulated with a high-frequency carrier. A typical amplitude modulated signal can be described by

x(t)=xm(t)cos(2πfct)x(t)=xm(t)cos(2πfct) size 12{x $$t$$ =x rSub { size 8{m} } $$t$$ "cos" $$2πf rSub { size 8{c} } t$$ } {}
(1)

where xm(t)xm(t) size 12{x rSub { size 8{m} } $$t$$ } {}is called the message waveform, which contains the data of interest, and fcfc size 12{f rSub { size 8{c} } } {}is the carrier wave frequency. Using the fact that

cos(2πfct)=12(e2πfct+e2πfct)=12(eωct+eωct)cos(2πfct)=12(e2πfct+e2πfct)=12(eωct+eωct) size 12{"cos" $$2πf rSub { size 8{c} } t$$ = { {1} over {2} } $$e rSup { size 8{2πf rSub { size 6{c} } t} } +e rSup { - 2πf rSub { size 6{c} } t} size 12{$$ = { {1} over {2} } $$e rSup {ω rSub { size 6{c} } t} } size 12{+e rSup { - ω rSub { size 6{c} } t} } size 12{$$ }} {}
(2)

and the frequency shift property of CTFT, one can easily derive the CTFT of to be

X(ω)=12Xm(ωωc)+Xm(ω+ωc)X(ω)=12Xm(ωωc)+Xm(ω+ωc) size 12{X $$ω$$ = { {1} over {2} } left (X rSub { size 8{m} } $$ω - ω rSub { size 8{c} }$$ +X rSub { size 8{m} } $$ω+ω rSub { size 8{c} }$$ right )} {}
(3)

At the receiver, some noisy version of this transmitted signal is received. The signal information resides in the envelope of the modulated signal, and thus an envelope detector can be used to recover the message signal.

Figure 12 shows the completed block diagram of the amplitude modulation and demodulation system. In this example, use the combination of two sine waves to serve as a message signal. The signal is modulated with a high-frequency carrier, and some random noise is added. The frequency domain versions of the signals can also be observed using the function fft. As stated in Equation (3), the CTFT of the modulated signal is merely some frequency-shifted version of the original signal. In single sideband (SSB) modulation, only one side of the spectrum is transmitted due to symmetry. That is, just one side of the spectrum is taken and converted into a time signal using the function ifft.

Figure 13 shows the completed front panel of this system. The Message signal, Modulated signal, Received signal (modulated signal with additional noise) and Demodulated signal are displayed in four waveform graphs in both the time and frequency domains.

Lab Exercises

Exercise 1

Circuit Analysis

Find and plot the frequency response (both magnitude and phase spectrum) of each of the circuits shown in Figure 14. Set the values of R, L and C as controls.

Solution

Insert Solution Text Here

Exercise 2

Morse Coding

Consider a message containing some hidden information. Furthermore, to make it interesting, suppose the message contains a name. Assume that the message was coded using the amplitude modulation scheme as follows (Reference):

x(t)=xm1(t)cos(2πf1t)+xm2(t)cos(2πf2t)+xm3(t)cos(2πf3t)x(t)=xm1(t)cos(2πf1t)+xm2(t)cos(2πf2t)+xm3(t)cos(2πf3t) size 12{x $$t$$ =x rSub { size 8{m1} } $$t$$ "cos" $$2πf rSub { size 8{1} } t$$ +x rSub { size 8{m2} } $$t$$ "cos" $$2πf rSub { size 8{2} } t$$ +x rSub { size 8{m3} } $$t$$ "cos" $$2πf rSub { size 8{3} } t$$ } {}
(4)

where xm1(t),xm2(t)xm1(t),xm2(t) size 12{x rSub { size 8{m1} } $$t$$ ,x rSub { size 8{m2} } $$t$$ } {} and xm3(t)xm3(t) size 12{x rSub { size 8{m3} } $$t$$ } {} are the (message) signals containing the three letters of the name. More specifically, each of the signals, xm1(t),xm2(t)xm1(t),xm2(t) size 12{x rSub { size 8{m1} } $$t$$ ,x rSub { size 8{m2} } $$t$$ } {} and xm3(t)xm3(t) size 12{x rSub { size 8{m3} } $$t$$ } {}, corresponds to a single letter of the alphabet. These letters are encoded using the International Morse Code as indicated below [7]:

A . H . . . . O V . . . B . . . I . . P . . W . C . . J . Q . X . . D . . K . R . . Y . E . L . . . S . . . Z . . F . . . M T G . N . U . . A . H . . . . O V . . . B . . . I . . P . . W . C . . J . Q . X . . D . . K . R . . Y . E . L . . . S . . . Z . . F . . . M T G . N . U . . size 12{ matrix { A {} # "." - {} {} # {} # H {} # "." "." "." "." {} # {} # O {} # - - - {} {} # {} # V {} # "." "." "." - {} {} ## B {} # - "." "." "." {} # {} # I {} # "." "." {} # {} # P {} # "." - - "." {} # {} # W {} # "." - - {} {} ## C {} # - "." - "." {} # {} # J {} # "." - - - {} {} # {} # Q {} # - - "." - {} {} # {} # X {} # - "." "." - {} {} ## D {} # - "." "." {} # {} # K {} # - "." - {} {} # {} # R {} # "." - "." {} # {} # Y {} # - "." - - {} {} ## E {} # "." {} # {} # L {} # "." - "." "." {} # {} # S {} # "." "." "." {} # {} # Z {} # - - "." "." {} ## F {} # "." "." - "." {} # {} # M {} # - - {} {} # {} # T {} # - {} {} # {} # {} # {} ## G {} # - - "." {} # {} # N {} # - "." {} # {} # U {} # "." "." - {} {} # {} # {} # {} } } {}

Now to encode the letter A, one needs only a dot followed by a dash. That is, only two prototype signals are needed – one to represent the dash and one to represent the dot. Thus, for instance, to represent the letter A, set xm1(t)=d(t)+dash(t)xm1(t)=d(t)+dash(t) size 12{x rSub { size 8{m1} } $$t$$ =d $$t$$ + ital "dash" $$t$$ } {}, where d(t)d(t) size 12{d $$t$$ } {} represents the dot signal and dash(t)dash(t) size 12{ ital "dash" $$t$$ } {} the dash signal. Similarly, to represent the letter O, set xm1(t)=3dash(t)xm1(t)=3dash(t) size 12{x rSub { size 8{m1} } $$t$$ =3 ital "dash" $$t$$ } {}.

Find the prototype signals d(t)d(t) size 12{d $$t$$ } {} and dash(t)dash(t) size 12{ ital "dash" $$t$$ } {} in the file morse.mat on the book website. After loading the file morse.mat

>>load morse

the signals d(t)d(t) size 12{d $$t$$ } {} and dash(t)dash(t) size 12{ ital "dash" $$t$$ } {}can be located in the vectors dot and dash, respectively. The hidden signal, which is encoded, per Equation (4), containing the letters of the name, is in the vector xtxt size 12{ ital "xt"} {} Let the three modulation frequencies f1,f2f1,f2 size 12{f rSub { size 8{1} } ,f rSub { size 8{2} } } {}and f3f3 size 12{f rSub { size 8{3} } } {} be 20, 40 and 80 Hz, respectively.

• Using the amplitude modulation property of the CTFT, determine the three possible letters and the hidden name. (Hint: Plot the CTFT of xtxt size 12{ ital "xt"} {} Use the values of TT size 12{T} {} and τauτau size 12{τ ital "au"} {} contained in the file.)

• Explain the strategy used to decode the message. Is the coding technique ambiguous? That is, is there a one-to-one mapping between the message waveforms ( xm1(t),xm2(t),xm3(t))xm1(t),xm2(t),xm3(t)) size 12{x rSub { size 8{m1} } $$t$$ ,x rSub { size 8{m2} } $$t$$ ,x rSub { size 8{m3} } $$t$$ \) } {}) and the alphabet letters? Or can you find multiple letters that correspond to the same message waveform?

Solution

Insert Solution Text Here

Exercise 3

Doppler Effect

The Doppler effect phenomenon was covered in a previous chapter. In this exercise, let us examine the Doppler effect with a real sound wave rather than a periodic signal. The wave file firetrucksiren.wav on the book website contains a firetruck siren. Read the file using the LabVIEW MathScript function wavread and produce its upscale and downscale versions. Show the waves in the time and frequency domains (find the CTFT). Furthermore, play the sounds using the LabVIEW function Play Waveform. Figure 15 shows a typical front panel for this system.

Solution

Insert Solution Text Here

Exercise 4

Diffraction of Light

The diffraction of light can be described as a Fourier transform (Reference). Consider an opaque screen with a small slit being illuminated by a normally incident uniform light wave, as shown in Figure 16.

Considering that d>>πl12/λd>>πl12/λ size 12{d">>"πl rSub { size 8{1} rSup { size 8{2} } } /λ} {}provides a good approximation for any l1l1 size 12{l rSub { size 8{1} } } {}in the slit, the electric field strength of the light striking the viewing screen can be expressed as (Reference)

E0(l0)=Kej(2πd/λ)jλdej(π/λd)l02E1(l1)ej(/λd)l0l1dl1E0(l0)=Kej(2πd/λ)jλdej(π/λd)l02E1(l1)ej(/λd)l0l1dl1 size 12{E rSub { size 8{0} } $$l rSub { size 8{0} }$$ =K { {e rSup { size 8{j $$2πd/λ$$ } } } over {jλd} } e rSup { size 8{j $$π/λd$$ l rSub { size 6{0} rSup { size 6{2} } } } } Int cSub { - infinity } cSup { infinity } {E rSub {1} size 12{ $$l rSub {1} } size 12{$$ e rSup { - j $$2π/λd$$ l rSub { size 6{0} } l rSub { size 6{1} } } } size 12{ ital "dl" rSub {1} }} } {}
(5)

where

E1E1 size 12{E rSub { size 8{1} } } {}= field strength at diffraction screen

E0E0 size 12{E rSub { size 8{0} } } {} = field strength at viewing screen

KK size 12{K} {} = constant of proportionality

λλ size 12{λ} {}= wavelength of light

The above integral is in fact Fourier transformation in a different notation. One can write the field strength at the viewing screen as (Reference)

(t)E1fl0/λdE0(l0)=Kej(2πd/λ)jλdej(π/λd)l02CTFT(t)E1fl0/λdE0(l0)=Kej(2πd/λ)jλdej(π/λd)l02CTFT size 12{E rSub { size 8{0} } $$l rSub { size 8{0} }$$ =K { {e rSup { size 8{j $$2πd/λ$$ } } } over {jλd} } e rSup { size 8{j $$π/λd$$ l rSub { size 6{0} rSup { size 6{2} } } } } ital "CTFT" lbrace E rSub {1} size 12{ $$t$$ rbrace rSub {f rightarrow l rSub { size 6{0} } /λd} }} {}
(6)

The intensity I(l0)I(l0) size 12{I $$l rSub { size 8{0} }$$ } {}of the light at the viewing screen is the square of the magnitude of the field strength. That is,

I(l0)=E0(l0)2I(l0)=E0(l0)2 size 12{I $$l rSub { size 8{0} }$$ = lline E rSub { size 8{0} } $$l rSub { size 8{0} }$$ rline rSup { size 8{2} } } {}
(7)
1. Plot the intensity of the light at the viewing screen. Set the slit width to this range (0.5 to 5 mm), the wavelength of light λλ size 12{λ} {}to this range (300 to 800 nm), and the distance of the viewing screen dd size 12{d} {}to this range (10 to 200 m) as controls. Assume the constant of proportionality is 103103 size 12{"10" rSup { size 8{ - 3} } } {}, and the electric field strength at the diffraction screen is 1 V/m.
2. Now replace the slit with two slits, each 0.1 mm in width, separated by 1 mm (center-to-center) and centered on the optical axis. Plot the intensity of light in the viewing screen by setting the parameters in part (1) as controls.

Solution

Insert Solution Text Here

Content actions

PDF | EPUB (?)

What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags?

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks