Analyzing Composite Signals


One of the powerful uses of Fourier transforms is analyzing composite signals, those that are made up of multiple frequency components . You can transform a composite signal into the frequency domain and this will often provide insight into the nature of the signal. For example, consider the signal shown in Figure 22.3. It is difficult to say very much about the signal by looking at its amplitude-time curve.

Figure 22.3. Composite signal

graphics/22fig03.gif

But when the signal is transformed into the frequency domain using the discreteFT() method a much clearer picture arises. The signal was sampled 64 times in a total sample time of 1 second. The frequency spectrum for the range 0 to 32 Hz is shown in Figure 22.4. The negative part of the spectrum (the data from 32 to 64 Hz) was not plotted. We can see in Figure 22.4 that there are three components to the composite signal. There is a 4 Hz wave, a 7 Hz wave, and a 16 Hz wave. This result is completely correct, because the signal shown in Figure 22.3 was created using Eq. (22.20).

Figure 22.4. Composite signal frequency response

graphics/22fig04.gif

Equation 22.20

graphics/22equ20.gif


The code to produce the data shown in Figures 22.3 and 22.4 is shown next . It is named TestComplex.java and is just a slight variation on the TestDFT.java program described earlier.

 import TechJava.MathLib.*; public class TestComplex {   public static void main(String args[]) {     int N = 64;     double T = 1.0;     double tn, fk;     double data[] = new double[2*N];     //  A composite cosine function that is sampled     //  for one second at 64 samples/sec     for(int i=0; i<N; ++i) {       data[2*i] = Math.cos(8.0*Math.PI*i*T/N) +                   Math.cos(14.0*Math.PI*i*T/N) +                   Math.cos(32.0*Math.PI*i*T/N);       data[2*i+1] = 0.0;     }     //  Compute the Fourier transform     double X[] = Fourier.discreteFT(data, N, true);     //  Print out the frequency spectrum     System.out.println();     for(int k=0; k<N; ++k) {       fk = k/T;       System.out.println("f["+k+"] = "+fk+                      "  Xr["+k+"] = "+X[2*k]+                      "  Xi["+k+"] = "+X[2*k + 1]);     }   } } 


Technical Java. Applications for Science and Engineering
Technical Java: Applications for Science and Engineering
ISBN: 0131018159
EAN: 2147483647
Year: 2003
Pages: 281
Authors: Grant Palmer

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net