Quadrature Amplitude Modulation (QAM)
Objectives:
Definition
Modulation
Demodulation
Phase and frequency mismatch
Advantages and disadvantages of QAM
__________ Matlab code below (you need to use your own wave files___
% Dr. Ali Muqaibel 2017 modified 2018
%Demonstrating the impact of frequency and phase mismatch
clc
clear all
close all
% phase error in degrees
theta= 0; % try 0 ,1 , 10, 90 (order flip), 180
theta=theta*pi/180;
% frequency mismatch in Hz
delta_f=0; %try 0, 1 ,10,100
[m1, FS] = audioread ('Cat-Meow.wav');
[m2, FS] = audioread ('Chirping-Birds.wav');
% controlling the size to be the same as the shortest
m2=m2(1:length(m1),:);
%sound(m1,FS,NBITS)
%sound(m2,FS,NBITS)
% Defining the time vector
t=0:1/FS:1/FS*(length(m1)-1);
% Channel 1
r1(:,1)=m1(:,1)'.*cos(2*pi*delta_f.*t+theta)-m2(:,1)'.*sin(2*pi*delta_f.*t+theta);
% Channel 2
r1(:,2)=m1(:,2)'.*cos(2*pi*delta_f.*t+theta)-m2(:,2)'.*sin(2*pi*delta_f.*t+theta);
% the second output
% Channel 1
r2(:,1)=m1(:,1)'.*sin(2*pi*delta_f.*t+theta)+m2(:,1)'.*cos(2*pi*delta_f.*t+theta);
% Channel 2
r2(:,2)=m1(:,2)'.*sin(2*pi*delta_f.*t+theta)+m2(:,2)'.*cos(2*pi*delta_f.*t+theta);
% figure
figure (1)
subplot(2,2,1)
plot(t,m1)
xlabel('time, t')
ylabel('Amplitude')
title('m1: Cat-Meow')
subplot(2,2,2)
plot(t,r1)
xlabel('time, t')
ylabel('Amplitude')
title('r1: Received Cat-Meow')
subplot(2,2,3)
plot(t,m2)
xlabel('time, t')
ylabel('Amplitude')
title('m2: Chirping-Birds')
subplot(2,2,4)
plot(t,r2)
xlabel('time, t')
ylabel('Amplitude')
title('r2: Chirping-Birds')
% sound out
sound(10*r1,FS)
pause(2)
sound(4*r2,FS)