Up&down Sampling
Up&down Sampling
% Original sequence
x = [1, 2, 3, 4, 5]; % Define the original sequence
L = 3; % Upsampling factor (e.g., 3 times upsampling)
subplot(2, 1, 2);
stem(n_upsampled, y, 'filled');
title(['Upsampled Sequence (Factor = ', num2str(L), ')']);
xlabel('Time (normalized)');
ylabel('Amplitude');
grid on;
Down sampling
% Original sequence
x = [1, 2, 3, 4, 5, 6, 7, 8, 9]; % Define the original sequence
M = 2; % Downsampling factor (e.g., 2 times
downsampling)
subplot(2, 1, 2);
stem(n_downsampled, y, 'filled');
title(['Downsampled Sequence (Factor = ', num2str(M), ')']);
xlabel('Time (normalized)');
ylabel('Amplitude');
grid on;