## Solution

You can use a scaling factor to convert the x-axis so that it appears in hertz (Hz). The scaling factor depends on the sampling rate and framesize you select.

When you configure the Analog Input Elemental I/O Node on your DSP target to acquire data from the codec, you must specify a sampling rate and a framesize. For example, you can specify the default sampling rate of 8,000 Hz and a framesize of 128 samples. Using the EMB Real FFT VI or the Spectral Measurements Express VI to transform the input signal from the time domain to the frequency domain.

By default, the waveform graph distributes points on the x-axis based on the framesize you select. In this example, the waveform graph evenly distributes points from 0–127 along the x-axis, as shown in the following figure.

The waveform graph plots the data at 128 points, or frequency bins, along the x-axis. To scale these bins to a hertz value specific to the period of the signal, you must apply the following formula to each point on the x-axis:

`bin number * sampling rate/framesize`

In this example, the sampling rate divided by framesize is 8,000/128 or 62.5, so you must scale the x-axis by 62.5. After scaling the x-axis by 62.5, it looks like the following figure.

**Scaling the X-axis on a Waveform Graph**Complete the following steps to scale the x-axis.

- Right-click the waveform graph indicator and choose
**Properties** from the shortcut menu to open the **Waveform Graph Properties** dialog box. - Click the
**Scales** tab. - Select
**Time (X-axis) **from the pull-down menu. - Enter
`62.5`

in the **Multiplier** text box in the **Scaling Factors** section. - Enter
`Frequency (Hz)`

in the **Name** text box. - Remove the checkmark from the
**Autoscale** checkbox and enter `4000`

in the **Maximum** text box. According to the Nyquist sampling theorem (linked below), data in frequency bins greater than half of the sampling rate is aliased and not valid. In this example, 4,000 is half of the sampling rate of 8,000 Hz. - Click the
**OK** button to close the **Waveform Graph Properties** dialog box and run the DSP VI.

The following figure shows the waveform graph property changes described above.