top of page

Understanding FFT Through a MATLAB Signal Processing Study Kit A practical guide for structural vibration analysis

7 days ago
7 min read

The Fast Fourier Transform is widely used in structural dynamics, vibration measurement, machine-condition monitoring, and floor-performance assessment. Yet it is often treated as a black-box command: send a time record into fft(), plot a spectrum, and trust the result.


That shortcut is convenient, but it hides the ideas that matter in engineering: what each frequency bin means, how phase is retained, why sampling and record length change the plot, and when a deterministic spectrum must give way to a statistical PSD description.

The companion MATLAB study kit was developed to make those ideas visible. It calculates the DFT manually using cosine and sine projections, compares the result with MATLAB’s FFT, reconstructs signals with the IFFT, and then extends the same logic to convolution, filtering, random vibration, complex dynamic stiffness, and vibration isolation.


Three ideas to remember

·    The FFT is a fast implementation of frequency-by-frequency projection; it does not create new physics.

·    Amplitude without phase is incomplete. The IFFT reconstructs a specific time history only when the complex spectrum is retained.

·    For structural vibration, the same frequency-domain language connects measured signals, finite-element response, PSD analysis, isolation, and acceptance criteria.


 

1  The Fourier transform as a projection test

Consider a sampled signal x[n] with N points. For every frequency index k, the DFT compares the signal with two orthogonal templates: a cosine slot and a negative-sine slot. Each comparison is a dot product across the complete record.


Ck measures how much of the kth cosine template is present. Ik measures how much of the negative-sine template is present. The complex coefficient X[k] simply stores these two coordinates together. The symbol i is bookkeeping for a perpendicular axis; it does not imply that the physical displacement, velocity, or acceleration is imaginary.


Magnitude tells us the strength at that frequency, while phase tells us the orientation of the cosine–sine vector. A sine wave with a different starting phase does not disappear from the DFT: its projection is redistributed between the two slots.

What the manual MATLAB lesson does

for k = 0:N-1

    C(k+1) = sum(x .* cos(2*pi*k*n/N));

    I(k+1) = -sum(x .* sin(2*pi*k*n/N));

end

Xmanual = C + 1i*I;

The result is compared directly with fft(x). This is the most useful conceptual bridge: the built-in FFT gives the same coefficients, but computes them much more efficiently.

Why a real signal creates conjugate pairs

For real x[n], reversing the frequency sign leaves the cosine template unchanged and reverses the sine-template sign. Therefore the cosine coordinate is the same, the sine coordinate changes sign, and X[N−k] is the complex conjugate of X[k]. The array index N−k is how the negative frequency −k is stored in MATLAB’s 0-to-N−1 DFT ordering.


 

2  FFT and IFFT are analysis and synthesis

The FFT converts a time record into complex frequency coefficients. The IFFT performs the reverse synthesis: it adds all cosine and sine contributions, with their stored phases, to rebuild the time history.

X = fft(x);

xRecovered = real(ifft(X));

MATLAB places the 1/N normalization inside ifft(). Other textbooks and software may place it in the forward transform, split it symmetrically, or apply 2/N when constructing a one-sided amplitude spectrum. These are conventions, not different transforms. The chosen forward and inverse scalings must remain consistent.

Quantity

What it preserves

Can it reconstruct the measured record?

Complex FFT X[k]

Amplitude and phase

Yes, subject to numerical precision

Magnitude |X[k]| only

Amplitude only

No; phase has been discarded

PSD Sxx(f)

Mean-square intensity by frequency

No unique record; many histories share the same PSD

 

3  Sampling rate, record length, and zero padding


Sampling rate controls the highest measurable frequency. Record duration controls the true frequency-bin spacing. Adding more measured samples can improve either quantity, depending on whether the sampling interval or the total duration changes.

Change

What changes physically

Main effect

Increase Fs, same duration

Smaller time step; more measured points

Higher Nyquist frequency

Increase duration, same Fs

Longer observation window

Finer true frequency resolution

Append zeros

No new measurement information

Denser interpolation of the plotted spectrum

 

Zero padding does not replace measured data and is not a filter. Zeros are appended after the record to evaluate the same finite-record transform on a denser frequency grid. Use it for smoother-looking curves, more convenient peak-location estimates, or FFT-based linear convolution. Do not claim that it improves the ability to separate two closely spaced tones; that requires a longer real measurement.


 

4  Convolution and filtering

Convolution describes how a system with impulse response h[n] reacts to an input x[n]. The time-domain procedure is shift, multiply, and sum. In the frequency domain, the same operation becomes point-by-point multiplication.

Physically, divide the load history into short intervals. The load in each interval acts like a small impulse with area F(τ)Δτ. Its response is a scaled copy of the impulse response, shifted to the instant τ at which that load acts. Superimposing the responses from all current and earlier intervals produces the total response at time t. The convolution integral is the limiting form of this bar-by-bar summation as Δτ approaches zero.


This equivalence explains why filtering is so naturally expressed in the frequency domain. A filter is a selected transfer function H[k]. It retains, attenuates, or removes chosen frequency bands, while the IFFT returns the filtered time record.

X = fft(x, Nfft);

H = fft(h, Nfft);

y = real(ifft(X .* H));

For linear convolution, choose Nfft at least Nx + Nh − 1. Otherwise, the FFT implements circular convolution and the tail wraps back to the beginning. Zero padding here is a numerical requirement for obtaining the desired linear-convolution result.

The three basic filter shapes

Filter

Passes

Typical vibration use

Low-pass

Frequencies below a cutoff

Remove high-frequency electrical or sensor noise

Band-pass

A selected frequency interval

Inspect a machine order, modal band, or 1/3-octave band

High-pass

Frequencies above a cutoff

Remove drift, tilt, or very-low-frequency baseline motion

 

A filter need not be memorized as a mysterious formula. It is better understood as a stencil chosen for the required task. However, real filters have transition bands, phase behavior, and startup transients. For quantitative work, document the cutoff definition, filter order, direction, and whether zero-phase processing was used.

Animated convolution lesson

The study kit animates the moving kernel. At each output index, the kernel is shifted over the signal, overlapping values are multiplied, and those products are summed. Watching the overlap change makes the convolution integral far easier to understand than reading the equation alone.



 

5  PSD and random vibration

An FFT answers a deterministic question: what complex frequency components are present in this particular finite record? A power spectral density answers a statistical question: how is the mean-square vibration intensity distributed with frequency?


Integrating the PSD over a band gives variance; taking the square root gives band-limited RMS. That is why PSD analysis is central when traffic, ambient floor motion, turbulence, or machinery excitation cannot be represented by one repeatable phase history.

Method

Input

Output

Best suited to

FFT / steady-state

Known complex amplitudes or harmonic loads

Amplitude and phase by frequency

Deterministic rotating machinery or measured complete records

PSD / random response

Auto- and cross-spectral densities

Response PSD, variance, RMS

Broadband or uncertain stochastic excitation

 

What random analysis does and does not provide

·    It provides response intensity by frequency, total or band-limited RMS, and—when assumptions are defined—statistical peak estimates.

·    It does not provide a unique time history because PSD contains no unique phase sequence.

·    If a complete measured acceleration record is available, a deterministic FFT–response–IFFT workflow can preserve the actual phase relationships. Random analysis is still valuable when the record is only one realization or when design must represent a population of possible events.

One-third-octave and VC checks

For vibration-criterion checks, do not simply overlay raw FFT-bin peaks on a VC limit. Combine the mean-square velocity within each specified 1/3-octave band and take the square root. The criterion is then compared with band RMS velocity, using the measurement duration, weighting, and band definitions required by the governing project specification.



 

6  Complex dynamic stiffness for structural response

In a finite-element model, a linear harmonic response at circular frequency ω is obtained from the complex dynamic-stiffness equation. Mass and stiffness remain real, while viscous damping introduces the imaginary term that carries the phase lag.


MATLAB solves this equation directly. There is no need to separate the real and imaginary parts before Gaussian elimination unless a real-only solver is being used.

Z = K - omega^2*M + 1i*omega*C;

U = Z \ F;

V = 1i*omega*U;

A = -omega^2*U;

The displacement response U is complex. Its modulus is the steady-state amplitude, and its angle is the phase relative to the chosen load reference. Plotting only the maximum real component can underestimate the harmonic amplitude because the peak may occur at another phase.

A two-degree-of-freedom lesson

The study kit sweeps frequency, solves the 2×2 complex system at every point, and plots the frequency-response magnitude and phase. It also constructs an equivalent doubled real system to verify that both formulations agree. This is a compact preparation for modal superposition, base excitation, and larger finite-element frequency-response analyses.

Engineering quantity

Frequency-domain relation

Interpretation

Displacement

U(ω)

Complex response amplitude and phase

Velocity

V(ω) = iωU(ω)

Magnitude multiplied by ω; phase advanced by 90°

Acceleration

A(ω) = −ω²U(ω)

Magnitude multiplied by ω²; phase reversed

 

Model accuracy still governs the answer. Mesh convergence, realistic mass distribution, boundary conditions, damping, cracking assumptions, and credible forcing data matter far more than the fact that the final velocity is reported in micrometres per second.


 

7  Vibration isolation solved by DFT

A measured base-acceleration record can be transformed, passed through the isolator transfer function, and reconstructed. Because H(f) is complex, the calculation retains both amplitude change and phase shift.


The frequency regions have a direct physical interpretation. At low frequency, the isolated equipment tends to follow the floor. Near the isolator natural frequency, resonance may amplify motion. Above the isolation threshold, transmissibility falls and isolation becomes effective. This is why an isolator should never be selected from its static stiffness alone.

Recommended engineering workflow

Step

Action

Result

1

Measure or define input acceleration, force, or PSD with units and sampling metadata.

Traceable excitation

2

Check sampling, duration, detrending, leakage, windowing, and scaling.

Reliable spectrum

3

Compute structural or isolator transfer functions with justified damping.

Complex response relation

4

Combine input and transfer function consistently: complex spectrum or PSD.

Output spectrum or response PSD

5

Recover time history when phase exists; otherwise calculate RMS statistics.

Time or statistical response

6

Compare using the criterion’s prescribed band, RMS, location, and operating condition.

Defensible compliance check

 

What the study kit provides

·    A MATLAB GUI with editable signal, sampling, filter, structural, and isolation parameters.

·    Executable lessons for FFT/IFFT, manual DFT projections, convolution, filtering, PSD, complex signals, 2DOF response, and isolation.

·    A convolution animation, numerical checks, and an expanded study guide connecting the algorithms to structural-dynamics decisions.


bottom of page