spectrum_analyzer()
Performs a spectrum analysis for the input voltage/current data
Syntax
spectrum = spectrum_analyzer(data, fCarrier, start, stop, window, resBW)
Arguments
| Name | Description | Range | Type | Default | Required |
|---|---|---|---|---|---|
| data | baseband or complex envelope voltage/current signal | (-∞, ∞) | real, complex | yes | |
| fCarrier | frequency around which the spectrum will be centered | [0, ∞) | real | 0 | no |
| start | start time for the spectrum analysis | [0, ∞) | integer, real | first point of input data | no |
| stop | stop time for the spectrum analysis | [0, ∞) | integer, real | last point of input data | no |
| window | type of window to be used | [0, 7]† | integer, string | 0 | no |
| resBW | resolution bandwidth | [0, ∞) | integer, real | 0 | no |
| † See Notes for the window type | |||||
Examples
spectrum = spectrum_analyzer(Vout[1])
where Vout is a named node in a Circuit Envelope simulation, will return the voltage spectrum at the fundamental frequency. The spectrum will be centered around 0 Hz. All the input data will be processed in one block resulting in the highest resolution bandwidth possible. No windowing will be done.
spectrum = spectrum_analyzer(Vout[1], 3.5e9, , , "Kaiser 7.865", 30e3)
where Vout is a named node in a Circuit Envelope simulation, will return the voltage spectrum at the fundamental frequency. The spectrum will be centered around 3.5 GHz. The input signal will be broken down in smaller segments in order to achieve 30 kHz of resolution bandwidth. All segments will be windowed with a Kaiser 7.865 window. The spectra of all segments will be averaged.
spectrum = spectrum_analyzer(T1, , 1.0e-3, 2.0e-3, "Hanning 0.5")
where T1 is the name of a TimedSink component (in a DSP schematic), will return the voltage spectrum for the segment between 1 msec and 2 msec of the signal recorded in the TimedSink. Of course, the TimedSink component must have recorded a signal that starts before 1 msec and ends after 2 msec. The spectrum will be centered around 0 Hz. A Hanning 0.5 window will be used.
Defined in
Built in
See Also
Notes/Equations
Used in Circuit Envelope and Signal Processing simulations.
This expression can be used with input data of up to two dimensions. It can handle both baseband as well as complex envelope input data. Although non-uniformly sampled data is supported, it is recommended to use this expression with uniformly sampled data.
The spectrum_analyzer() expression returns the voltage or current spectrum of the input (voltage or current) signal. The returned values are the complex amplitude voltages or currents at the frequencies of the spectral tones. The returned values are not the powers at the frequencies of the spectral tones. However, one can calculate and display the power spectrum by using the dbm() expression (for voltage input data) or writing a simple equation (for current input data) in the data display window.
Note that, for baseband signals and for the frequency of 0 Hz, the dBm function returns a power value that is 3 dB less than the actual power. This is because the primary use of the dBm function is with RF signals, where the 0 Hz frequency corresponds to the carrier frequency and not really 0 Hz signal frequency. If the baseband signal has no significant power at DC, this 3 dB error is insignificant and can be ignored-otherwise, it must be considered.
The basis of the algorithm used by the spectrum_analyzer() expression is the fs() expression (the chirp-Z transform option of fs() is used). The input data can be processed as one block and the spectrum calculated over the entire input signal. Alternatively, the input signal can be broken down in smaller blocks and the spectra of all blocks averaged.
The fCarrier argument sets the frequency around which the spectrum will be centered. This is only true for a complex envelope signal. For baseband signals, this argument is ignored. The spectrum span is:
- for complex envelope signals [fCarrier-0.5/TStep, fCarrier+0.5/TStep]
- for baseband signals [0, 0.5/TStep]
where TStep is the simulation time step.
If it is not desirable to process all the input data, the start and stop arguments can be used to define a segment of the input data to be processed. This can be useful when trying to exclude parts of the signal where transients occur.
The window argument sets the window that will be used to window the input data. Windowing is often necessary in transform-based (chirp-Z, FFT) spectrum estimation. Without windowing, the estimated spectrum may suffer from spectral leakage that can cause misleading measurements or masking of weak signal spectral detail by spurious artifacts. If the input data is broken down in multiple blocks then the window is applied to each block.
The window argument accepts the following strings: "none", "Hamming 0.54", "Hanning 0.50", "Gaussian 0.75", "Kaiser 7.865", "8510 6.0", "Blackman", "Blackman-Harris". The equations defining these windows are given below:
- none:

where N is the window size - Hamming 0.54:

where N is the window size - Hanning 0.5:

where N is the window size - Gaussian 0.75:

where N is the window size - Kaiser 7.865:

where N is the window size, α = N / 2, and I 0 (.) is the 0th order modified Bessel function of the first kind - 8510 6.0 (Kaiser 6.0):

where N is the window size, α = N / 2, and I 0 (.) is the 0th order modified Bessel function of the first kind - Blackman:

where N is the window size - Blackman-Harris:

where N is the window size
The resBW parameter can be used to set the spectrum measurement resolution bandwidth. If set to 0, it is ignored and the signal segment defined by start and stop is processed as one segment. In this mode of operation, the returned spectrum will have the highest possible resolution bandwidth (resolution bandwidth is inversely proportional to the input signal length). If resBW is set to a value greater than 0, then the input signal segment defined by start and stop is broken down in smaller subsegments of the appropriate length. The length of each segment is decided based on the value of resBW and the selected window. The spectrum of each subsegment is calculated and averaged with the spectra of the other subsegments. In this mode of operation, the resolution bandwidth achieved is resBW. Averaging multiple input signal segments. shows an example where the input signal is broken down in multiple segments. As can be seen in this figure, if an exact integer multiple of subsegments cannot fit in the segment defined by start and stop, then part of the signal may not be used.
Averaging multiple input signal segments.
In an analog swept spectrum analyzer, the resolution bandwidth is determined by the last in a series of analog IF filters. In contrast, the spectrum_analyzer() expression calculates the spectrum using DSP algorithms and so the resolution bandwidth is determined by the length of the input data segment the algorithm processes and the selected window.
ResBW = ENBW = NENBW / T
where ENBW is the window equivalent noise bandwidth
T is the length of the input data segment in seconds and
NENBW is the window normalized equivalent noise bandwidth The following table shows the NENBW values for the available windows).
| Window | NENBW |
|---|---|
| none | 1.0 |
| Hamming 0.54 | 1.363 |
| Hanning 0.5 | 1.5 |
| Gaussian 0.75 | 1.883 |
| Kaiser 7.865 | 1.653 |
| 8510 6.0 | 1.467 |
| Blackman | 1.727 |
| Blackman-Harris | 2.021 |
The equivalent noise bandwidth (ENBW) of a window is defined as the width of a rectangular filter that passes the same amount of white noise as the window. The normalized equivalent noise bandwidth (NENBW) is computed by multiplying ENBW with the time record length. For example, a Hanning window with a 0.5 second input data segment will result in an ENBW (as well as ResBW) of 3 Hz (1.5 / 0.5).
How to choose the right window
Every time a window is applied to a signal (Window = none effectively applies a rectangular window to the signal), leakage occurs, that is, power from one spectral component leaks into the adjacent ones. Leakage from strong spectral components can result in hiding/masking of nearby weaker spectral components. Even strong spectral components can be affected by leakage. For example, two strong spectral components close to each other can appear as one due to leakage.
Choosing the right window for a spectral measurement is very important. The choice of window depends on what is being measured and what the trade-offs between frequency resolution (ability to distinguish spectral components of comparable strength that are close to each other) and dynamic range (ability to measure signals with spectral components of widely varying strengths and distributed over a wide range) are.
As described above, windows can be characterized by their Normalized Equivalent Noise Bandwidth (NENBW). In general, for the same length of signal processed, the higher the NENBW of a window the higher its dynamic range (less leakage) and the poorer its frequency resolution.
Some general guidelines for choosing a window are given below:
- Do not use a window (Window = none) when analyzing transients.
- For periodic signals whose spectral components have comparable strengths and when the signal segment processed includes an exact integer multiple of periods, the best results are obtained if no window is used (Window = none, which is equivalent to using a rectangular window). Any start up transients should be excluded.
- For periodic signals whose spectral components have significantly different strengths and/or when the signal segment processed does not include an exact integer multiple of periods, the use of a window can improve the detection of the weaker spectral components. The higher the NENBW the more likely the weaker spectral components will be detected. However, this trades-off frequency resolution and so if the spectral components are very close to each other the weaker one might remain unresolved. To improve frequency resolution while still maintaining a good dynamic range use a window but process a longer signal segment.
- For aperiodic signals such as modulated signals (QPSK, QAM, GSM, EDGE, CDMA, OFDM) the use of a window is highly recommended. The window will attenuate the signal at both ends of the signal segment processed to zero. This makes the signal apear periodic and reduces leakage.
Privacy
Statement
|
Terms of Use
|
Legal |
Contact Us
|
© Agilent 2000-2008 ![]()
