Understanding Aliasing, Sampling Rate and the Use of Power Spectral Densities
Aliasing is the misinterpretation of high frequencies (above half of the sampling frequency) as lower frequencies. This is a problem that must be avoided when digitizing continuous signals.
This m-file psdchk1.m below demonstrates how to determine the frequency of an incoming signal. The user will specify up to three functions. These functions are summed and their resulting function is then plotted and its Power Spectral Density (PSD) is calculated and plotted. Click here for an example using this m-file.
It is important to try different functions, sampling rates and total time of gathered data to see its effects. Of course in real applications, the input function is rarely known and you must rely purely on the output for analysis. Try different inputs and see if you can determine the function solely by viewing the two graphs.
Can you tell the frequencies of the three functions by only reviewing the PSD plot?
What about the Amplitude of each function? Can this be estimated from the PSD plot?
% This m-file psdchk1.m was created by Professor Ron Adrezin
% of The Cooper Union, School of Engineering
% on 5/04/97. It was last modified on 5/04/97.
% The purpose of this m-file is to demonstrate how to
% determine the frequency of an incoming signal.
% The user will specify up to three functions.
% These functions are summed and their
% resulting function is then plotted and its Power Spectral
% Density (PSD) is calculated and plotted.
% Can you tell the frequencies of the three functions
% by only reviewing the PSD plot? What about the Amplitude
% of each function? Can this be estimated from the PSD plot?
% FunctA: the first function
% A1: amplitude of the first function in meters
% f1: frequency of the first function in Hz
% FunctB: the second function
% A2: amplitude of the second function in meters
% f2: frequency of the second function in Hz
% FunctC: the third function
% A3: amplitude of the third function in meters
% f3: frequency of the third function in Hz
% FunctTotal: the sum of the three functions
% fs: the sampling frequency in Hz
% t: time in seconds
% t0: start time in seconds
% tf: final time in seconds
title('Plot of FunctTotal');
p=spectrum(FunctTotal,512); %This requires at least 1024 points
% It also must be 2 to a power.
Return to Brief Review
Support for the development of this module was provided by the National Science Foundation and The Cooper Union for the Advancement of Science and Art.
Please send questions or comments to Professor Ron Adrezin or Professor Daniel Raichel.