fftamp-func
Calculate amplitude from FFT complex result.
vector fftamp(vector<complex> cx, int side = 1)
cx
side
Return the amplitude.
// Import the signal data string fname$ = system.path.program$ + "Samples\Signal Processing\fftfilter1.DAT"; impASC fname:=fname$; // Define a range variable for input signal range rSignal = col(2); // Add four new columns to store the amplitude results // Column C would be one-sided result // Column D would be two-sided result // Column E would be one sided result with DC offset removed worksheet -a 3; // Set column labels to distinguish col(C)[L]$ = "Amplitude"; col(C)[C]$ = "One-Sided"; col(D)[L]$ = "Amplitude"; col(D)[C]$ = "Two-Sided"; col(E)[L]$ = "Amplitude"; col(E)[C]$ = "DC Offset Removal"; // First use fftc to get FFT complex result // Then use fftamp to get amplitude in column C and D col(C) = fftamp(fftc(rSignal));// One-Sided col(D) = fftamp(fftc(rSignal), 2);// Two-Sided and shift col(E) = fftamp(fftc(rSignal - mean(rSignal)));//DC Offset Removal
fftmag, fftc, fftphase, windata