DSP Lab Open ended Fall 2023
DSP Lab Open ended Fall 2023
Name:Sawera Altaf
REG noCpen211101008
% Parameters
t = 0:1/fs:T-1/fs;
% SSB-AM modulation
carrier_signal = cos(2*pi*f_c*t);
% SSB-AM demodulation
figure;
subplot(3,1,1);
plot(t, message_signal);
title('Message Signal');
subplot(3,1,2);
plot(t, ssb_am_modulated_signal);
subplot(3,1,3);
plot(t, ssb_am_demodulated_signal);
xlabel('Time (seconds)');
Page 2 of 2
Q#2. (CLO-2) [PLO-2] [05]
Filter the sinusoidal signal using the band stop filter that has been designed. View the original signal and the
filtered signal in the Spectrum Analyzer. The tone at 1 kHz is unaffected. The tone at 12 kHz is filtered out and
attenuated, and the tone at 16 kHz is mildly attenuated because it appears in the transition band of the filter.
Page 3 of 2
% Apply the filter
figure;
subplot(2,1,1);
plot(t, signal);
title('Original Signal');
subplot(2,1,2);
plot(t, filtered_signal);
title('Filtered Signal');
xlabel('Time (s)');
function qam_modulation_example()
Page 4 of 2
% Example of QAM modulation
figure;
xlabel('Time (s)');
ylabel('Amplitude');
grid on;
end
samples_per_symbol = 100;
Page 5 of 2
symbol_rate = 1000; % in symbols per second
% Time array
for i = 1:length(symbols_I)
end
% QAM modulation
Page 6 of 2
end
% Sample signal
fs = 1000; % Sampling frequency in Hz
t = 0:1/fs:1; % Time vector
f1 = 50; % Frequency of the first sinusoidal component
f2 = 150; % Frequency of the second sinusoidal component
signal = sin(2*pi*f1*t) + 0.5*sin(2*pi*f2*t);
subplot(2,1,1);
plot(t, signal);
title('Original Signal');
xlabel('Time (s)');
ylabel('Amplitude');
subplot(2,1,2);
plot(t, filtered_signal);
title('Signal after Bandstop Filtering');
Page 7 of 2
xlabel('Time (s)');
ylabel('Amplitude');
Page 8 of 2