Baseband Transmistion with Noise

조회 수: 1 (최근 30일)
James Hayek
James Hayek 2015년 7월 20일
댓글: Walter Roberson 2015년 7월 20일
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?

채택된 답변

Walter Roberson
Walter Roberson 2015년 7월 20일
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)
  댓글 수: 2
James Hayek
James Hayek 2015년 7월 20일
That worked to alleviate the error, thanks. May I ask, why write:
signal_i + 1i*signal_q
what is the 1i?
Why not just
scatterplot(signal_i+signal_q) ?
Walter Roberson
Walter Roberson 2015년 7월 20일
1i is the imaginary unit, which can also be written as i alone. signal_i + 1i*signal_q makes each signal complex with the real part from signal_i and the imaginary part from signal_q . The documentation for scatterplot() says that when given complex data, it uses the two components for quadrature plot. Which sounded a lot like what you wanted for your *_q signal.
Another way of building the complex signal would have been
scatterplot(complex(signal_i, signal_q))

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Waveform Generation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by