Demonstration of Fourier series in continuous time signal

The Fourier series is a powerful mathematical tool used to represent periodic functions as a sum of sinusoidal functions.
9 download
Aggiornato 24 apr 2024

Visualizza la licenza

Signal processing applications can demonstrate the Fourier series of continuous time signal in application such as audio signal processing.
Music and sound synthesis explore the application of Fourier series in music and sound synthesis.
Real world signal analysis apply Fourier signal such as biomedical signals (EEG,ECG)
% Parameters
T = 1; % Period of the signal
fs = 1000; % Sampling frequency
t = 0:1/fs:5*T; % Time vector
% Generate a continuous-time signal
x = sawtooth(2*pi*t/T); % Sawtooth wave with period T
% Compute the Fourier series coefficients
N = 20; % Number of harmonics
a0 = mean(x); % DC component
an = zeros(1, N); % Initialize array for cosine coefficients
bn = zeros(1, N); % Initialize array for sine coefficients
for n = 1:N
an(n) = 2/T * trapz(t, x.*cos(2*pi*n*t/T)); % Cosine coefficient
bn(n) = 2/T * trapz(t, x.*sin(2*pi*n*t/T)); % Sine coefficient
end
% Reconstruct the signal using the Fourier series
x_hat = a0/2;
for n = 1:N
x_hat = x_hat + an(n)*cos(2*pi*n*t/T) + bn(n)*sin(2*pi*n*t/T);
end
% Plot the original signal and reconstructed signal
figure;
subplot(2,1,1);
plot(t, x);
title('Original Signal');
xlabel('Time');
ylabel('Amplitude');
subplot(2,1,2);
plot(t, x_hat);
title('Reconstructed Signal using Fourier Series');
xlabel('Time');
ylabel('Amplitude');

Cita come

SRIHARANI (2025). Demonstration of Fourier series in continuous time signal (https://it.mathworks.com/matlabcentral/fileexchange/164326-demonstration-of-fourier-series-in-continuous-time-signal), MATLAB Central File Exchange. Recuperato .

Compatibilità della release di MATLAB
Creato con R2024a
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux
Riconoscimenti

Ispirato da: Fourier series of real signals

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versione Pubblicato Note della release
1.0.0