sampling and filtering in discrete time modulation
Version 1.0.0 (273 KB) by
Vishalini
Sampling converts continuous-time signals to discrete-time, following Nyquist-Shannon theorem for fidelity.
1. The project will comprehensively cover sampling techniques (uniform, non-uniform, oversampling) and filtering methods (FIR, IIR), elucidating their theoretical underpinnings and practical applications.
2. Practical demonstrations, simulations, and hands-on experiments will be employed to illustrate the principles and real-world significance of sampling and filtering in digital signal processing systems, fostering practical skills and insights among participants.
% Define parameters
Fs = 1000; % Sampling frequency (Hz)
T = 1/Fs; % Sampling period
t = 0:T:1; % Time vector (1 second duration)
f1 = 10; % Frequency of the original signal (Hz)
A = 1; % Amplitude of the original signal
% Generate original signal (sine wave)
x = A*sin(2*pi*f1*t);
% Plot original signal
subplot(3,1,1);
plot(t, x);
title('Original Signal');
xlabel('Time (s)');
ylabel('Amplitude');
% Sample the signal
Fs_new = 50; % New sampling frequency (Hz)
T_new = 1/Fs_new; % New sampling period
n = 0:T_new:1; % New time vector
x_sampled = A*sin(2*pi*f1*n); % Sampled signal
% Plot sampled signal
subplot(3,1,2);
stem(n, x_sampled);
title('Sampled Signal');
xlabel('Time (s)');
ylabel('Amplitude');
% Apply low-pass filtering (simple moving average)
N = 10; % Filter length (number of samples)
b = ones(1, N)/N; % Filter coefficients (moving average)
x_filtered = filter(b, 1, x_sampled); % Filtered signal
% Plot filtered signal
subplot(3,1,3);
stem(n, x_filtered);
title('Filtered Signal');
xlabel('Time (s)');
ylabel('Amplitude');
% Display original and filtered signal frequency content
figure;
freqz(b, 1, length(x_sampled), Fs_new);
title('Frequency Response of Filter');
Cite As
Vishalini (2025). sampling and filtering in discrete time modulation (https://www.mathworks.com/matlabcentral/fileexchange/164341-sampling-and-filtering-in-discrete-time-modulation), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2024a
Compatible with any release
Platform Compatibility
Windows macOS LinuxTags
Acknowledgements
Inspired by: PAM modulation in time and frequency domain, Sampling Theorem Illustration, sampling and filtering in continuous time modulation
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0 |