ME 470 01 C1 Fourier Example 2 in MATLAB
Joseph Mahoney
0:00 / 0:00
ME 470 01 C1 Fourier Example 2 in MATLAB
165 просмотров · 6 лет назад
Joseph Mahoney
178 подписчиков
165 просмотров · 6 лет назад
Fourier Series Example 2 in MATLAB: Piecewise Periodic Signal, Partial Sums, and Gibbs Phenomenon
Now that the analytic Fourier series is in hand, this video shows how to implement it in MATLAB for a discontinuous, piecewise periodic function. You will define the original waveform using mod(t,T) and logical indexing, then build Fourier partial sums (1 term, 15 terms, and 30 terms) to see how the approximation improves. You will also quantify the improvement with the same norm-based error calculation used in the earlier MATLAB example.
Signal used in this example
Period T = 2 seconds
x(t) equals 0 from t = 0 to t = 0.5 seconds in each period
x(t) equals 2 from t = 0.5 to t = 2 seconds in each period
What you will see in MATLAB
Updating the period and fundamental frequency for T = 2
Building a repeating piecewise function with mod(t,T) plus logical statements
Coding the Fourier summation term-by-term and using cumulative summation for partial sums
Comparing multiple truncation levels on the same plot
Gibbs phenomenon near the discontinuities, even as the straight segments improve
Error trending downward as you add terms, plus why the absolute error depends on the number of time steps
Notes and full video set for this section
https://sites.google.com/view/mechani...
Related videos from this channel (strong match for this topic)
Fourier series procedure (analytic setup): • ME 470 01 A Procedure for Fourier Series e...
Fourier series of a periodic function: • ME 470 01 B Finding the Fourier series exp...
Fourier Example 1 in MATLAB: • ME 470 01 B1 Fourier Example 1 in MATLAB
Fourier series of a periodic piecewise function (analytic): • ME 470 01 C Finding the Fourier series exp...
Discrete Fourier series: • ME 470 01 D Discrete Fourier Series
DFT small data example: • ME 470 01 E DFT Small Data Example
Spectral analysis and PSD: • ME 470 01 F Spectral Analysis and PSD
PSD example: • ME 470 01 G PSD Example
DFT with differentiation and integration: • ME 470 01 H DFT with Differentiation and I...
#MechanicalVibrations #FourierSeries #MATLAB #SignalProcessing #FrequencyAnalysis #VibrationAnalysis
Timestamps
0:00 Moving from the analytic solution to MATLAB
0:24 Update the period to T = 2 and set the time vector
0:42 Define the piecewise periodic x(t) using mod and logical indexing
1:52 Quick plot check to verify the waveform
2:34 Build the Fourier summation term for this piecewise case
3:34 Fixing a typo and setting truncations for comparison
4:12 Compare 1-term, 15-term, and 30-term partial sums
4:47 Gibbs phenomenon at the discontinuities
5:04 Compute the error and interpret the trend with more terms
5:28 Why the absolute error changes with time-step resolution