Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problem with QPSK modulation of a random antipodal signal in Matlab

Status
Not open for further replies.
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:
??? 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?
 

multiple probs:
1. by giving 4 as input to qammod, you are no longer anitpodal; you want to send 2 bits/symbol using a 4-point constellation
2. the 'h' objects expects an array of integer values in the range 0 to 3 (like x = randint (1,3,4)), which is taken as the decimal equivalent of the binary pattern you want to send, taken 2bits at a time. Thus, you dont give it the sin/cos multiplied value
3. the qammode doesnt produce the sine or cos waveform, it merely given the constellation points (the baseband values) to which your data is mapped into, which means if the transmitted signal is going to be -cos(wt) + sin(wt), qammod gives you just (-1+i1)
- b
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top