E
ejspins
Guest
I'm trying to modulate a random antipodal signal sampled at 4 symbols per second, but I can't seem to write the code right in matlab.
I'm using the command: modem.qammod to create a handle for my modulator, but I keep getting the error message:
Here is my code:
Is there something wrong with my input signal? Or am I not using the qammod command correctly?
I'm using the command: modem.qammod to create a handle for my modulator, but I keep getting the error message:
??? Error using ==> modem.abstractMod.checkModInput at 35
Input X must be an integer-valued double-precision matrix.
Error in ==> test at 12
x1 = modulate(h,x);
Here is my code:
Code:
clear all;close all;clc
fs = 1000;
ntr = 1000;
t = 0:1/(fs-1):1;
x = ((sign(randn(1,ntr))+i*sign(randn(1,ntr))).*...
((cos(2*pi*fs*t))+(i*sin(2*pi*fs*t))));
h = modem.qammod(4);
x1 = modulate(h,x);
%% Shaping Filter
x1shaped = rcosflt(x1,1,4,'fir/sqrt',0.5);
scatterplot(x1)
scatterplot(x1shaped)
Is there something wrong with my input signal? Or am I not using the qammod command correctly?