Skip to content Skip to navigation Skip to collection information

OpenStax_CNX

You are here: Home » Content » Fundamentals of Digital Signal Processing Lab » DSP Laboratory: Time and Frequency Displays

Navigation

Lenses

What is a lens?

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? tag icon

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

This content is ...

Affiliated with (What does "Affiliated with" mean?)

This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
  • NSF Partnership display tagshide tags

    This collection is included inLens: NSF Partnership in Signal Processing
    By: Sidney Burrus

    Click the "NSF Partnership" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

  • National Instruments display tagshide tags

    This collection is included in aLens by: National Instruments

    Comments:

    "The purpose of this course, EE 453 at Penn State University, is to familiarize students with DSP development by examining sampling, analysis, and reconstruction of continuous-time signals. […]"

    Click the "National Instruments" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

Also in these lenses

  • Lens for Engineering

    This module and collection are included inLens: Lens for Engineering
    By: Sidney Burrus

    Click the "Lens for Engineering" link to see all content selected in this lens.

  • NI Signal Processing display tagshide tags

    This collection is included inLens: Digital Signal Processing with NI LabVIEW and the National Instruments Platform
    By: Sam Shearman

    Comments:

    "Lab material that explores signal processing concepts using National Instruments LabVIEW DSP."

    Click the "NI Signal Processing" link to see all content selected in this lens.

    Click the tag icon tag icon to display tags associated with this content.

Recently Viewed

This feature requires Javascript to be enabled.

Tags

(What is a tag?)

These tags come from the endorsement, affiliation, and other lenses that include this content.
 

DSP Laboratory: Time and Frequency Displays

Module by: Erik Luther. E-mail the author

Time and Frequency Displays

LabVIEW DSP gives you the ability to view the data in time domain or take its Fourier Transform and view its frequency content. In this section of the lab, we’ll learn how to set up and interpret these views. In the later labs, you will need to set up these displays on a regular basis, so you may want to refer to this part of the lab in the future.

Time Domain

Whenever an analog signal is passed through an A/D converter, its samples are stored as a number (usually as an integer). If we have a 16-bit system, there are 216 = 65,536 possible values that can be stored. These stored values can be displayed either as discrete samples or as a smooth line connecting the samples. The instructions below outline how to set up a basic time-domain display using a Waveform Chart.

Switch over to the Front Panel and right click on the Front panel window anywhere to bring out the Controls palette. From the Graph palette bring out the Waveform Chart and place it on the Front Panel, as shown in step 1 of Figure 1. Right click on the Waveform Chart and select Properties from the popup menu as shown in step 2 of Figure 6. In the Chart Properties window on the Appearance tab change the Label to Left Channel Time Domain. Specify the settings as shown in step 4 of Figure 1. Deselecting Autoscale will ensure that the Y-axis of the chart does not change with the data values. Minimum and Maximum values of -32000 and 32000 will cover all the values for a 16-bit A/D channel.

Figure 1: Waveform Chart Properties
Figure 1 (Graphic1)

The Waveform Chart maintains a buffer of values that are plotted on it, the number of points that are stored can be adjusted by Right Clicking on the Chart and selecting Chart History Length… from the popup menu. By default the chart history length is 1024. Right Click on Waveform Chart from the Visible Items sub menu and select X Scrollbar to show the toolbar for the X-axis. From the same sub menu (Visible Items) select Graph Palette. This palette gives you the ability to zoom in on the data.

  1. Wire the Left output of the Analog Input Node to the Waveform Chart as shown in Figure 1 below.
    Figure 2: Chart Time Domain Data
    Figure 2 (Graphic2)
  2. Un-mute the microphone Input, run the program and speak into the microphone. You should be able to “see” your voice, in addition to hearing it. Play around with the properties of the Waveform Chart (Right Click and select Properties form the menu) and become familiar with the different options. Also use the zoom tools on the Graph Palette and become familiar with it.
  3. If you stop the program the currently displayed data will freeze on the Waveform Chart.
  4. Often, you’ll find it necessary to display less (or more) of the signal in the time-domain display. This is done by changing the Chart History Length from the popup menu of the Waveform Chart. The time range that will be displayed will always be
 Time Range = Chart History Length/Sample Frequency

Example 1

Using the default settings, the displayed time range is 1024/48000 = 0.02133 = 21.33 msec.

Frequency Domain Magnitude Display

  1. To display the frequency content of the audio signal we will take a Fast Fourier Transform (FFT) of the data and display it in a Waveform Chart. Add a second Waveform Chart Display to the Front Panel (as described in step 1 on page 7). Change the label of this Chart to Left Channel Frequency Domain and enable Autoscale for the Y-axis by checking the box in the Waveform Chart Properties window on the Scales Tab. On the Scales Tab switch over to the X axis properties by selecting it in the dropdown menu and change the X-axis range to 0-255.
  2. Switch over to the Block Diagram and resize the while loop as shown in Figure 8. Place the Spectral Measurements Express VI from the Functions>>Signal Processing>>Frequency Domain Sub-Palette. Refer to Figure 8 for details.
    Figure 3: FFT of the Audio Input
    Figure 3 (Graphic3)
  3. Wire the Block Diagram as in Figure 3.
    Figure 4: Frequency Domain Block Diagram
    Figure 4 (Graphic4)

Note:

The frequency-domain Waveform Chart will display the magnitude response in the range 0 (DC) to Fs /2.
  1. With the CD Audio input selected, run the program and examine the spectrum of the music signal. Now change the input to microphone and examine the frequency spectrum of your voice as well. Stop the program when done.
  2. The frequency spectrum is always displayed from 0 Hz. (DC) to Fs/2. For voice signals, which have most of the energy < 2000 Hz, the voice frequencies only cover a small portion of the display (assuming Fs = 48000 Hz.). To get a more detailed view of your voice spectrum, change the sampling frequency to 8000 Hz. (making sure to change both the Anaog Input and Analog Output nodes). Now, your voice spectrum will cover a wider range of the display. Run the VI.
  3. Speak into the microphone using a single held-out note (like AHHHHHHHHHH or EEEEEEEEEEE). Examine both the time-domain and frequency domain displays. If necessary, change the Chart History Length so that about 4-5 periods of the signal are on the time-domain display. Because a note like this is periodic, you should notice a fairly steady time signal as well as a well-defined frequency spectrum consisting of large peaks at your note’s fundamental frequency and its harmonics. Change the frequency (pitch) of this note and examine how it affects the frequency spectrum. Also try experimenting with various notes. Once you get a fairly steady display in both the time- and frequency-domains, hold your note and stop the program to freeze the displays. You can now zoom into various parts of the spectrum to examine it closely.

Answer These Questions

Exercise 1

From your time-domain plot, determine the fundamental period of your voice note (AHHHHHH, EEEEEEEE, etc.). Remember that the time base is in milliseconds. Measure the period as accurately as possible and record the period below. From your frequency-domain plot, determine the frequency of the 1st harmonic (fundamental frequency) and record it below as well. Do these results concur with each other? Why or why not?

Exercise 2

Fundamental Period of signal __________ Fundamental Frequency of signal __________

  • We are now ready to use the third input – the function generator. Begin by going to the Surround Mixer and changing the active playback device to Line-in. Make sure that the volume is set to 100%. Locate the black cable (with an RCA-type connector on the end) coming out of the computer – this cable is connected to the Line-in port of the sound card. Connect the other end of this cable to the Func Out port of the function generator using the RCA to BNC adapter. Turn on the function generator and set the following parameters. You need to press EXEC after setting each one.
    • FREQ: 400 Hz
    • AMPL: 0.2 V
    • OFST: 0 V (DC offset)
    • MODE: CONTINUOUS (use the  keys to cycle through the options if needed)
    • FUNC: SINE (use the  keys to cycle through the options if needed)
  • After all of these are set, press the OUT/ON button (bottom middle) and use the  keys to select OUTPUT ON. If you now run your VI again, you should hear a 400 Hz tone. You should also see the sine wave in the time- and frequency-domain Charts on your Front Panel. Use the Zoom tools to view the signals in detail.

Answer These Questions

Exercise 3

From the time-domain plot, measure the period of the sine wave and record it below. From the frequency-domain plot, measure the frequency of the sine wave and record it as well. Discuss whether these results concur with each other.

Exercise 4

Period of the sine wave __________ Frequency of the sine wave __________

  • Now change the amplitude of the sine wave to 1 V and observe the resulting frequency spectrum. Is this expected?

Answer These Questions

Exercise 5

Explain in detail what is happening to your frequency spectrum when you increase the amplitude of the sine wave to 1 V. Why is this happening?

  • When you’re done, stop the program and save the VI.

Collection Navigation

Content actions

Download:

Collection as:

PDF | EPUB (?)

What is an EPUB file?

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

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Module as:

PDF | EPUB (?)

What is an EPUB file?

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

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Add:

Collection to:

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? tag icon

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

Module to:

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? tag icon

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