MATLAB: Baseband Transmistion with Noise

baseband signal generation noise

I have a project where I am to assume a baseband transmission scheme that sends a stream of binary rectangular pulses of height A = ±1 V (with the positive pulse representing a binary 1 and the negative pulse represents a binary 0).
The transmitted signal will then contain noise, additive noise, which would be introduced.
I am to use use the mean and variance estimators to determine an estimate of the mean and the variance using the generated noise with no signal transmitted.
After I would like to then subtract the estimated mean from the noise process rendering it zero-mean (approximately).
Sounds like a long process and expecially one from someone who never used MatLab before.
I have a few quesions, lets start with if I am on the rihgt track. I am not sure if this is how I should start but below is my initial code:
close all
clc
%%Generation of a signal
%This takes a set of random numbers and converts them to bits 0's & 1's
%The 2*X-1 will create -1's in place of the 0's from the bit conversion.
signal_i = 2*(rand(1,10^5)>0.5)-1;
signal_q = zeros(1,10^5);
%In communication systems we have two channels, Tx and Rx for serial as
%an example. This is why we have singal i and q
scatterplot(signal_i, signal_q);
If considering this code as a good start, I have encountered an error running scatterplot()
This error is as follows:
Operands to the || and && operators must be convertible to logical scalar values.
Error in scatterplot (line 60)
if ((fix(n) ~= n) || (n <= 0))
Error in signalGeneration (line 11)
scatterplot(signal_i, signal_q);
Any thoughts?

Best Answer

scatterplot() takes as its second argument an "n" which says to plot every n'th signal.
You might want
scatterplot(signal_i + 1i * signal_q)
Related Question