# Introduction

The VSS power spectrum measurement, PWR_SPEC, produces a frequency domain plot when performing time domain analysis. Because the power spectrum measurement inherently performs a Fast Fourier Transform (FFT) operation, certain artifacts can arise in the data presented in the frequency domain. This article addresses the impact of FFT windowing type when using the power spectrum measurement. First, examples of FFT related phenomenon as witnessed in the power spectrum measurement will be shown. Next, some theory explaining these phenomenon will be presented. Finally, mitigation techniques to minimize some of the FFT nonideal effects will be discussed.

# Nonideal FFT Effects

Most of the FFT effects on the power spectrum measurement discussed in this article will concentrate on the FFT windowing type selected. FFT window type is selected as a secondary parameter in the PWR_SPEC measurement as shown in Figures 1 and 2:

Figure 1. VSS PWR_SPEC Measurement.

Figure 2. Secondary Parameters for the PWR_SPEC Measurement.

The *FFT Windowing *defaults to *Auto.* Based on the kind of signal being measured, the PWR_SPEC measurement tries to select the best of the windowing types shown in the pick list. The window type selected can be viewed in the information box by left clicking on the trace in the graph as shown in Figure 3:

Figure 3. PWR_SPEC Measurement Information Box

In most cases setting the FFT window type to *Auto* makes a good compromise, freeing the user from needing to consider an appropriate window type. However there will be situations where action is needed on selection of the FFT window type. Certain signal types and system configurations can lead to non desired power spectrum measurements. The next discussion highlights some of the nonideal outcomes that may occur in the power spectrum measurement as result of FFT signal processing.

__Resolving Closely Spaced Signals__

Figure 4 shows three traces all making a PWR_SPEC measurement on the same system diagram. The only difference between the traces is the selection of the windowing type.

Figure 4. Closely Spaced Signals with Different FFT Windowing Types.

With the blue trace, the two CW signals are easy to resolve. However with the green trace and especially the red trace, the ability to resolve the two signals diminishes. As will be discussed later, different FFT windows expressed in the frequency domain yield different bandwidths. The wider the bandwidth, the lower the ability to resolve closely spaced signals.

__Spectral Leakage__

Figure 5 demonstrates spectral leakage that becomes apparent when the signal frequency is not exactly the same as one of the discrete FFT frequencies:

Figure 5. Spectral Leakage in the PWR_SPEC Measurement.

For the left tone, the signal frequency is “on bin”, or exactly equal to one of the FFT frequencies, resulting in no spectral leakage. However for the tone on the right, its frequency is not on bin, resulting in an apparent spreading of the signal across the entire spectrum.

The two traces below show the power spectrum results from the same system diagram, the only difference being the selection of the windowing type.

Figure 6. Spectral Leakage with Different FFT Windowing Types

With proper selection of the FFT window, the amount of spectral leakage can be minimized. In this case the red trace’s spectral leakage is low enough to not mask the noise floor of the measurement.

__Scalloping Loss__

Shown in this graph are two signals whose amplitudes are identical. However in the measurement, there is an offset which in this case is 2.16 dB:

Figure 7. Scalloping Loss in the PWR_SPEC Measurement.

This amplitude offset results from the phenomenon known as scalloping loss which also occurs when the signal frequency is not equal to one of the discrete FFT frequencies.

__Equivalent Noise Bandwidth__

Another FFT window related anomaly occurs with noise and noise-like signals such as digitally modulated signals. The following graph shows the spectrum from the same system diagram that has a CW signal and noise, the only difference between the two traces is the selection of the FFT window type:

Figure 8. Noise Floor Offset with Different Windowing Types.

The amplitude of the CW signal for the two traces is the same, however the noise floors show nearly a four dB offset from each other.

In this example, the amplitude of the digitally modulated signal shows a very similar offset as the noise floor example above.

Figure 9. Digitally Modulated Signal Power Offset with Different FFT Windowing Types.

Each FFT windowing type has a different noise power bandwidth. The FFT window expressed in the frequency domain exhibits a bandpass like filter about each signal. The amount of noise power allowed to pass this bandpass differs with FFT window type resulting in an offset in the power spectrum measurement for noise and digitally modulated signals.

# Power Spectrum Measurement Bandwidth Types

Found in instrumentation such as spectrum analyzers are two bandwidth related parameters labelled Resolution Bandwidth Filter (RBW) and Video Bandwidth Filter (VBW). The VSS power spectrum measurement borrows these concepts using digital signal processing to realize these functions.

__RBW in the Power Spectrum Measurement__

The RBW serves as a bandpass filter centered on each signal in the spectrum. The narrower the bandwidth, the better the ability to separate closely spaced signals. The following plot shows a single tone with two different RBW settings:

Figure 10. RBW Setting Bandwidths

The red trace’s RBW setting is 10 times wider than the RBW setting used in the blue trace.

When two closely spaced signals are present, the two signals are only apparent with the narrower RBW setting:

Figure 11. Resolving Closely Spaced Signals with Different RBW Settings.

The other aspect of the RBW filter is the amount of noise allowed to pass through the filter. The following shows the power spectrum with two different RBW settings:

Figure 12. Noise Floor with Different RBW Settings.

The signal amplitude is the same for both RBW settings, however the noise floor differs. The noise floor difference is equal to:

For this example with RBW settings that differ by a factor of 10, the noise floor will differ by 10 dB.

However, just as in instrumentation, narrower RBW settings come at the price of measurement speed. The number of FFT points is directly proportional to the RBW setting. For instance in the above example, the 1 MHz RBW uses 2000 FFT points, whereas the 100 kHz RBW uses 20,000 FFT points.

The number of FFT points can be determined using the information window:

Figure 13. Information Box Showing the Number of FFT Points

Often times the noise floor is specified in dBm/Hz, that is noise in a 1 Hz bandwidth. When using a RBW other than 1 Hz, the 1 Hz noise power can be determined from:

For instance if the RBW is 1 MHz, then the 1 Hz noise power can be found by subtracting 60 dB from the measured noise floor.

__Auto FFT Bin Size__

When selecting RBW by bandwidth value, the number of FFT points is limited to a maximum of 1,048,576. This limitation ensures that the simulation time is not excessive. However, this FFT size limitation can affect minimum RBW setting. When this occurs, then the number of FFT points will need to be entered as the PWR_SPEC’s RBW/#Bins parameter.

This can be illustrated by example. The sampling frequency, as determined from the trace’s information box, is 2 GHz. The user sets RBW to 100 Hz. The number of FFT points that the PWR_SPEC measurement uses is computed from:

where F_{s} is the sampling frequency.

For this example, 2 GHz/100 Hz is 2e7 FFT points which exceeds the max FFT point limitation. When the maximum FFT point limitation is exceeded, then the RBW is limited to

In this example, the information box shows the actual RBW even though the user set the RBW parameter to 100 Hz:

Figure 14. Information Box Showing the Actual RBW when FFT Points are Limited to Default Maximum

Setting the PWR_SPEC measurement RBW/#Bins to 2e7 # FFT Bins, then the desired 100 Hz RBW can be achieved.

Figure 15. Information Box Showing Corrected RBW When Number of FFT Points are Entered Manually

Just be aware that this large a FFT size will make the simulation time dramatically longer.

__VBW in The Power Spectrum Measurement__

The Video Bandwidth (VBW) filter is associated with trace averaging. The following plot shows the effect of trace averaging:

Figure 16. Noise Floor with Different Amount of Trace Averaging.

Trace averaging is important when the signals of interest are close to the noise floor.

The VSS power spectrum allows the selection of the VBW setting in either bandwidth or number of trace averages. If the bandwidth setting is chosen, the number of corresponding trace averages can be determined from the information window that is accessed by clicking on the trace:

Figure 17. Information Box Showing Number of Trace Averages

Just as with instrumentation, more trace averages, or lower the VBW bandwidth setting, the longer the measurement time.

# DSP Sampling and Windowing Theory

This section provides a limited tutorial on the FFT windowing process that is used in digital signal processing (DSP). For a more detailed explanation, consulting a textbook on the subject is recommended. The intent here is to give enough of a theoretical understanding of the windowing process so that apparent anomalies viewed in the VSS power spectrum measurement results can be better explained. With this understanding will come mitigation techniques to achieve results that closer match expected results.

__Sampling Theory__

A well known property of the Fourier transform is that a pulse in the time domain results in a sinc function, sin(x)/x, in the frequency domain. Shown below is the magnitude expressed in dB of the frequency domain sinc function:

Figure 18. Log Magnitude of the Sinc Function in the Frequency Domain

This importance of this fundamental concept becomes apparent when signal sampling is considered.

At the heart of digital signal process is the sampling of continuous signals as shown below:

Figure 19. Sampling of a Continuous Time Domain Signal.

The ideal sampler functions as a switch closing once every sampling period, Ts. The sampling frequency, Fs, is 1/Ts. The result is the sampled signal with finite sampling duration. The time domain appears as a pulsed RF and it is the pulse in the time domain that gets transformed into the sinc response in the frequency domain. Expressed in the frequency domain, the CW signal shows the sinc function superimposed upon it:

Figure 20. FFT Spectrum of a CW Signal whose Frequency Matches One of the FFT Frequencies.

The bins in the frequency domain are separated by Fs/N where N is the number of time domain samples. The literature mentions the use of zero stuffing to decrease the frequency bin spacing; the assumption here is that zero stuffing is not used.

As depicted above, ideally the sinc nulls fall on the frequency bins, resulting in a single spectral response located at the signal frequency. But this only occurs if the signal frequency falls on an FFT frequency bin, that is signal frequency is:

__Spectral Leakage__

In general, the signal frequency is not an integral submultiple of Fs/N. The following depicts the situation where the signal frequency is not on bin:

Figure 21. Sampling and FFT of a CW Signal where the Frequency does not Match One of the FFT Frequencies.

In the time domain at the end of the sampling interval, there is an abrupt transition. In the frequency domain, the sinc pulse that is superimposed upon the signal frequency spectral component shows that the nulls of the sinc response do not fall exactly on the frequency bins. There is spectral energy at multiple bins. This phenomenon is known as spectral leakage.

The spectral leakage becomes a problem in that the leakage from one larger amplitude signal can mask a nearby lower amplitude signal as depicted here:

Figure 22. Spectral Leakage Masking a Nearby Lower Amplitude Signal

The next section will address how spectral leakage can be suppressed.

__FFT Windowing__

Suppressing spectral leakage is accomplished by applying a FFT window to the time domain samples before performing the FFT operation. The idea is to taper the time domain waveform at the start and end of the sampling interval so that abrupt edges are minimized.

Figure 23. Sampling with FFT Windowing Function Applied

The following plot shows time domain responses of a CW signal where the lighter trace shows the unwindowed time domain waveform of the signal and the darker traces shows the windowed waveform:

Figure 24. Windowing in the Time Domain

In the frequency domain, the spectral leakage is dramatically minimized when FFT windowing is applied. Here the red trace is the frequency domain spectrum without windowing and the blue is the same time domain sample, but with windowing applied:

Figure 25. Spectral Leakage with and without Windowing Applied.

The signal at 0.5 GHz that was completely masked by the spectral leakage of the unwindowed spectrum is now clearly visible once windowing is applied.

# FFT Window Properties

With the general theory of FFT windowing introduced, this section review some of the windowing properties that distinguish one window type from another.

In the VSS power spectrum measurement, there are several FFT windowing types in which to choose. Selecting the proper window for any given measurement scenario requires understanding the properties of the windowing function. The following graphs in this section show time domain and frequency domain comparisons of a few different windowing functions. Each signal response uses 4096 samples.

__Time Domain Envelope__

Most windowing functions taper the time domain waveform such that the waveform amplitudes are zero at the start and stop of the sampling interval. But some windowing functions, such as the Kaiser window shown here, leave a small discontinuity at the sampling interval edges:

Figure 26. FFT Window Time Domain Envelopes

The Rectangular widow has a very abrupt edge. It may not seem appropriate, but no windowing is considered a windowing function. The selection in the VSS power spectrum measurement this is labelled *None* and in the literature this is labelled *Rectangular.* Later in this discussion it will become apparent that this abrupt edge has some serious performance limitations.

Although somewhat interesting, the time domain envelopes themselves do not give much useful information on the frequency domain properties of the window. Viewing the windowing function in the frequency domain is most appropriate for the power spectrum measurement.

__3 dB Bandwidth__

The 3 dB bandwidth is considered an important figure of merit for determining the ability to separate closely spaced signals. Shown here are the frequency domain responses of a few windows:

Figure 27. FFT Windowing 3 dB Bandwidths

The 3 dB bandwidth expressed in the number of FFT frequency bins ranges from 0.88 for the Rectangular window to 1.44 for the Hanning (the names Hann and Hanning are both used interchangeably in the literature) window.

For the VSS power spectrum measurement, the parameter RBW/# Bins is used to set the frequency spacing. Independent of FFT windowing type selected, the frequency spacing between frequency bins is always Fs/N where N is the number of FFT points. If the user sets RBW/# Bins parameter to a bandwidth value, then the frequency spacing will be that bandwidth value. The number of FFT points will be adjusted accordingly. For instance if the RBW/# Bins parameter is set to 1 MHz, then the frequency spacing of the power spectrum measurement will be 1 MHz. This behavior is different from most instrumentation where the RBW setting often implies the 3 dB bandwidth of the resolution bandwidth filter. This is an important distinction between VSS and instrumentation and can lead to confusion if not understood.

Because VSS power spectrum measurement keeps a constant frequency bin spacing independent of FFT windowing type selected, the resolving power of closely spaced signals is dependent of which windowing type has been selected. The windowing type with the lower 3 dB bin value will have a better ability to resolve closely spaced signals. The windowing type available in the PWR_SPEC measurement with the narrowest 3 dB bandwidth expressed in frequency bins is the *Rectangular* or *None* window.

__Equivalent Noise Bandwidth__

It is readily apparent by observing the FFT windowing function responses in the frequency domain in Figure 27 that each windowing function has a different frequency response. Integrating the area under the magnitude squared of the windowing frequency response yields the windowing function’s power gain. Multiplying the windowing function’s power gain by the noise power results in the windowing function’s noise power. Because of the varying frequency responses of each windowing functions, the noise power will also vary between windowing functions.

A figure of merit is the *Equivalent Noise Bandwidth* (ENBW). If a perfect brick-wall filter could be constructed such that its power gain is the same as the power gain of the windowing function, the bandwidth of the brick-wall filter would be ENBW as depicted in Figure 28:

Figure 28. Equivalent Noise Bandwidth

ENBW is wider than the 3 dB bandwidth and it is also wider than the frequency bin spacing. The VSS power spectrum measurement uses the same frequency bin spacing independent of the FFT windowing function selected and as a result the noise power will vary with FFT windowing function. This behavior is shown in Figure 29:

Figure 29. Noise Power Differences with Different FFT Windowing Functions.

The noise power is predictable and is based on ENBW expressed in number of frequency bins. For the Rectangular window, the ENBW is 1 bin wide. For the Flat Top window, the ENBW is 3.77 bins wide. The noise offset is given by:

For the Flat Top windowing function the noise power offset is 5.76 dB. For the Rectangular window, the noise power offset is 0 dB (i.e. no offset).

__Sidelobe Suppression__

Another very important aspect of the windowing function relates to the suppression of spectral leakage. The literature refers to this figure of merit as *Sidelobe Suppression*. Figure 30 shows the sidelobe suppression of a few windowing functions over a relative narrow frequency range.

Figure 30. Narrowband View of FFT Windowing Sidelobes.

In figure 31 the same windowing functions are shown over a wider frequency range.

Figure 31. Wideband View of FFT Windowing Sidelobes.

Note: only the peaks of the sidelobes are plotted in Figure 31. Maximum sidelobe suppression occurs at a frequency offset that is 25% of the number of FFT points. As Figure 31 demonstrates, the selection of the windowing function has a huge impact on the amount of spectral leakage.

__Scalloping Loss__

As mentioned in the discussion centered around Figure 7, amplitudes of displayed CW signals can exhibit an offset as result of a phenomenon known as *Scalloping Loss*. Scalloping loss occurs when the signal frequency does not fall on a FFT frequency bin. As explained for the reason behind spectral leakage, the windowing function displayed in the frequency domain is centered on the signal. However, spectral energy can only be displayed at the bin frequencies. So, the amplitude of the signal at the closest bin frequency to the signal frequency will be the highest amplitude, but as illustrated in Figure 32, that amplitude will be attenuated due to the superimposed windowing response:

Figure 32. Scalloping Loss

The scalloping loss is greatest when the signal frequency falls half way between FFT frequency bins. And because the windowing function frequency response differs between windowing types, the amount of scalloping loss will also differ with windowing type. Figure 33 shows the scalloping loss (darker trace) using the Rectangular windowing function.

Figure 33. Rectangular Window Scalloping Loss

For the Rectangular window, the maximum scalloping loss is nearly 4 dB. In Figure 34 where the 4-term Blackmann-Harris window is shown, the scalloping loss is considerably lower at less than 1 dB.

Figure 34. 4-term Blackmann-Harris Window Scalloping Loss

# Comparison of FFT Windowing Function Performance

Above the reasoning behind the various windowing figures of merit was presented. This section now summarizes the figures of merits for the windowing functions that are used by VSS.

The following table shows figures of merit for 3 dB BW, ENBW and scalloping loss for the windowing functions available in the VSS power spectrum measurement.

Table 1. FFT Windowing Function 3 dB BW, ENBW, and Scalloping Loss

Sidelobe suppression for these windowing types is shown in Figure 35 and Table 2.

Figure 35. Sidelobe Frequency Response

Table 2. Tabular Results for Sidelobe Suppression.

This data shows that a large selection of windowing functions exist because the performance of each varies so much. Unfortunately each one has a trade off. For instance, for best amplitude accuracy the Flat Top is the best choice due to its low scalloping loss. However, Flat Top has the widest bandwidth, so resolving closely spaced signals is problematic and Flat Top has the highest noise power offset. Rectangular is the best choice for resolving power, but the worst choice for spectral leakage.

# Which FFT Windowing Function to Use?

The question often comes up, what is the recommended windowing function? The quick answer is that each system is unique and it is impossible to make a general recommendation. With the information provided in the above tables, the user now has the information to assess their particular situation and choose the windowing function accordingly.

Fortunately VSS tries to assess the system and choose the best windowing function if the windowing type is set to the *Auto* position, which is the default. System assessment is based largely on the signal type (modulated vs. CW) and number of trace averages among other criterion.

# Compensating for ENBW

Scalloping loss and spectral leakage can not be compensated. The only fallback is to choose another windowing type to affect the behavior. However, the noise floor offset is something that can be compensated. A device know as *processing gain* can be used to adjust the displayed power of noise and noise-like signals. This property can be used to compensate for the noise floor and digitally modulated signal power offset.

__Processing Gain__

Figure 12 demonstrates that the noise floor changes with RBW setting. Because RBW is a function of the number of FFT points, then it follows that the noise floor is a function of the number of FFT points. This is known in the literature as *processing gain*. The amount of processing gain of noise and noise-like signals is given by:

where N_{1} and N_{2} are the number of FFT points. So by doubling the number of FFT points, the noise floor drops 3.01 dB. By increasing the number of FFT points by a factor of 10 drops the noise floor by 10 dB.

__Using Processing Gain in the PWR_SPEC Measurement__

In the PWR_SPEC measurement, the number of FFT Bins can be used instead of RBW setting as shown in Figure 36:

Figure 36. Entering Number of FFT Bins in the PWR_SPEC Measurement.

For all windowing types, the displayed noise power offset is an increase. So the compensation required is to decrease the noise power offset. First set the RBW to a desired bandwidth and simulate. View the number of FFT bins for that measurement using the information box (left click on the trace in the graph). Use Table 1 to look up the ENBW bins for the selected windowing type. Multiply the number of bins by the ENBW bins. Set the #FFT Bins in the PWR_SPEC measurement for the calculated number of bins.

Figure 37 shows an example using the Hann window. The red trace shows the response with RBW set to 1 MHz. The number of FFT bins for this measurement is 2000. Table 1 shows that the ENBW bins for the Hann window is 1.5. So the new number of FFT bins is 2000 x 1.5 = 3000. Set #FFT Bins in the PWR_SPEC measurement to 3000 and the result is the blue trace.

Figure 37. Compensated Noise Floor

Note the marker value of the blue trace being -114 dBm. This is measured in a 1 MHz RBW that has been compensated for ENBW. To get the 1 Hz noise power density, subtract 10*log_{10}(1 MHz) = 60 dB and the result is the correct value of -174 dBm/Hz.

__Use Noise Offset from Figure of Merit Table__

The alternative that does not require adjusting the number of FFT bins is to use Table 1, *Noise Power Offset due to ENBW[dB]* column. Use the values in that column to subtract the offset from the measured noise power or the power of noise-like signals.

__Use the PWR_MTR Measurement__

For accurate power of noise and noise-like signals another alternative is to use the PWR_MTR measurement and adjust the Band Center and Bandwidth parameters appropriately.

Figure 38. PWR_MTR Measurement

The PWR_MTR measurement compensates for noise power offset so that it reports accurate noise power for all FFT Window type settings.

# Conclusion

For the RF designer using VSS for system level analysis, certain aspects of using time domain analysis may come as a surprise. Many of the seemingly incorrect simulation results stem from the FFT windowing process. This article has provided some back ground on the windowing process so that now the user can make the necessary adjustments to compensate for these nonideal outcomes.