Understanding of Power Spectrum

Source: Internet
Author: User

The following MATLAB program uses the cycle graph method, correlation function method, and AR Spectrum Method to Calculate the power spectrum of signals.

% Power Spectrum estimatedclear all; clc; close all; FS = 1000; % sampling frequency nfft = 1024; % FFT calculation points % generate noise-containing sequence n =/Fs: 1; xn = cos (2 * pI * 100 * n) + 3 * Cos (2 * pI * 200 * n) + (2 * randn (SIZE (N ))); subplot (, 1); plot (Xn); Title ('noisy sign'); grid on % Cycle Graph Method window = boxcar (length (Xn )); % rectangular window [psd1, F] = periodogram (Xn, window, nfft, FS); % direct method psd1 = psd1/MAX (psd1); subplot (2, 2 ); plot (F, 10 * log10 (psd1 + 0.000001); Title ('cycle graph method'); grid on % auto-correlation method cxn = xcorr (Xn, 'unbiased '); % auto-correlation function cxk = FFT (cxn, nfft); psd2 = ABS (cxk); Index = 0: round (nfft/2-1 ); k = Index * fs/nfft; psd2 = psd2/MAX (psd2); psd2 = 10 * log10 (psd2 (index + 1) + 0.000001); subplot (, 3 ); plot (K, psd2); Title ('Auto correlation method'); grid on % AR Spectrum psd3 = pyulear (Xn, FS, nfft ); psd3 = psd3/MAX (psd3); psd3 = psd3/MAX (psd3); Index = 0: round (nfft/2-1 ); psd3 = 10 * log10 (psd3 (index + 1) + 0.000001); subplot (, 4); plot (K, psd3); Title ('ar spectral analyzer '); grid on;

Here are some points about power spectrum:

  1. The data in the power spectrum is relative values, and it cannot provide the actual absolute amplitude of the signal. Generally, you only need to look at the ratio between peaks. You can also normalize the data.

  2. The peak value in the power spectrum represents the periodic component in the signal, and the hidden cyclic signal energy is greater than the random signal (which is generally understandable ). For example, the preceding XN is

    xn=cos(2*pi*100*n)+3*cos(2*pi*200*n)+(2*randn(size(n)));

    The period consists of 100Hz and Hz, and the amplitude of Hz is greater than Hz. In the power spectrum diagram, the signal contains Hz and Hz.

  3. The direct method is also called the periodic graph method. It regards n observations of the random sequence x (n) as a sequence with limited energy and directly computes the Discrete Fourier transformation of x (n, obtain X (K), then take the square of its amplitude, and divide it by N as the estimation of the real power spectrum of the sequence x (n ).

  4. The indirect method first estimates from the correlation function R (n) by the sequence x (n), and then performs Fourier transformation on R (n) to obtain the power spectrum estimation of x (n ).

  5. When the average cycle graph method is used to calculate the power spectrum, the general power shape shows a sawing shape, and the accurate position of the spectrum peak is not great. So we can use other methods to smooth the spectrum, just to make the image smooth, and not to make the essence of the wave distorted and distorted. On the other hand, the essence of things will surely be displayed as they are not pure things removed! The degree of smoothness can be based on the analyzed signal, select a reasonable Window Function and bandwidth!

  6. The results obtained by the average cycle graph method and other methods are identical if the parameter conditions are the same.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.