Main Content

enbw

Equivalent noise bandwidth

Description

bw = enbw(window) returns the two-sided equivalent noise bandwidth, bw, for a uniformly sampled window, window. The equivalent noise bandwidth is normalized by the noise power per frequency bin.

example

bw = enbw(window,fs) returns the two-sided equivalent noise bandwidth, bw, in Hz.

example

Examples

collapse all

Determine the equivalent noise bandwidth of a Hamming window 1000 samples in length.

bw = enbw(hamming(1000))
bw = 
1.3638

Determine the equivalent noise bandwidth in Hz of a flat top window 10000 samples in length. The sample rate is 44.1 kHz.

bw = enbw(flattopwin(10000),44.1e3)
bw = 
16.6285

Obtain the equivalent rectangular noise bandwidth of a 128-sample Hann window.

Generate the window and compute its discrete Fourier transform over 2048 frequencies. Shift the transform so it is centered at zero frequency and compute its squared magnitude.

lw = 128;
win = hann(lw);
lt = 2048;
windft = fftshift(fft(win,lt));

ad = abs(windft).^2;
mg = max(ad);

Specify a sample rate of 1 kHz. Use enbw to compute the equivalent noise bandwidth of the window and verify that the value coincides with the definition.

fs = 1000;

bw = enbw(win,fs)
bw = 
11.8110
bdef = sum((win).^2)/sum(win)^2*fs
bdef = 
11.8110

Plot the squared magnitude of the window. Overlay a rectangle with height equal to the peak of the squared magnitude and width equal to the equivalent noise bandwidth.

freq = -fs/2:fs/lt:fs/2-fs/lt;

plot(freq,ad, ...
    bw/2*[-1 -1 1 1],mg*[0 1 1 0],'--')
xlim(bw*[-1 1])

Figure contains an axes object. The axes object contains 2 objects of type line.

Verify that the area of the rectangle contains the same total power as the window.

Adiff = trapz(freq,ad)-bw*mg
Adiff = 
2.1828e-11

Repeat the computation using normalized frequencies. Find the equivalent noise bandwidth of the window. Verify that enbw gives the same value as the definition.

bw = enbw(win)
bw = 
1.5118
bdef = sum((win).^2)/sum(win)^2*lw
bdef = 
1.5118

Plot the squared magnitude of the window. Overlay a rectangle with height equal to the peak of the squared magnitude and width equal to the equivalent noise bandwidth.

freqn = -1/2:1/lt:1/2-1/lt;

plot(freqn,ad, ...
    bw/2*[-1 -1 1 1]/lw,mg*[0 1 1 0],'--')
xlim(bw*[-1 1]/lw)

Figure contains an axes object. The axes object contains 2 objects of type line.

Verify that the area of the rectangle contains the same total power as the window.

Adiff = trapz(freqn,ad)-bw*mg/lw
Adiff = 
7.1054e-15

Input Arguments

collapse all

Uniformly sampled window vector, specified as a row or column vector with real-valued elements.

Example: hamming(1000)

Data Types: double | single

Sampling frequency, specified as a positive scalar.

Output Arguments

collapse all

Equivalent noise bandwidth, specified as a positive scalar.

Data Types: double | single

More About

collapse all

References

[1] harris, fredric j. “On the Use of Windows for Harmonic Analysis with the Discrete Fourier Transform.” Proceedings of the IEEE®. Vol. 66, January 1978, pp. 51–83.

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2013a

See Also

|