Перейти к содержимому

ME 470 01 E DFT Small Data Example

Joseph Mahoney

0:00 / 0:00

ME 470 01 E DFT Small Data Example

149 просмотров · 6 лет назад
Joseph Mahoney
178 подписчиков
149 просмотров · 6 лет назад
Discrete Fourier Transform Small Data Example in MATLAB (DFT and Discrete Fourier Series) This video walks through a simple, hand-sized dataset so you can see exactly how the discrete Fourier series and the DFT are implemented from their definitions. You will enter time stamps and signal values, compute the constant term a0, compute the first three harmonics (a1 to a3 and b1 to b3), reconstruct the signal with sine and cosine terms, and quantify the fit using RMSE. Key ideas covered Working with discrete data: you have samples t and x, not an analytic x(t) Constant time step dt and why it matters for DFT calculations Important detail: this dataset starts at t = dt (not t = 0), so your time vector must match the sampling Total sampling duration sets the effective period T for the expansion (here the data runs to 0.32 s) Fundamental frequency w = 2*pi/T (smaller w comes from sampling for longer) Definition-based coefficients: a0 = 2*sum(x)/N an = (2/N)*sum( x .* cos(2*pi*n*t/T) ) bn = (2/N)*sum( x .* sin(2*pi*n*t/T) ) Reconstructed signal: y = a0/2 + sum over n of [ an*cos(2*pi*n*t/T) + bn*sin(2*pi*n*t/T) ] Plotting measured points versus the reconstructed curve (first three harmonics) RMSE for comparing reconstructions as you add more terms: RMSE = norm(x - y)/sqrt(N) Notes and full set of videos for this topic https://sites.google.com/view/mechani... Watch next (same channel, strong match) Discrete Fourier Series fundamentals:    • ME 470 01 D Discrete Fourier Series   Spectral analysis and PSD overview:    • ME 470 01 F Spectral Analysis and PSD   PSD worked example:    • ME 470 01 G PSD Example   DFT property shortcuts (differentiation and integration):    • ME 470 01 H DFT with Differentiation and I...   Fourier series playlist (full sequence):    • Fourier Series   #DFT #DiscreteFourierTransform #MATLAB #SignalProcessing #FrequencyAnalysis #PowerSpectralDensity Timestamps 0:00 Goal: reconstruct discrete data using the first three harmonics 0:57 Enter the time stamps and signal values in MATLAB 1:25 Why the time vector starts at dt instead of 0 2:10 Total sample duration and defining the effective period T 2:24 Compute the fundamental frequency w = 2*pi/T 3:04 Plot the raw discrete data points 3:48 Compute the constant term a0 (twice the average value) 4:55 Set the number of harmonics (m = 3) and pre-allocate arrays 6:20 Implement an and bn using the definition-based summations 7:18 Build y by accumulating terms inside the for loop 9:39 Review a1 to a3 and b1 to b3 and the reconstructed y 10:20 Plot measured points versus reconstructed signal 11:42 Compute RMSE and how it is used when adding more terms 13:10 What improves when you increase the number of harmonics