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.

BPSK modulation code with carrier over AWGN and demodulation m file

Status
Not open for further replies.

ashfaqahmed

Newbie level 4
Joined
Feb 23, 2009
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,313
bpsk.m

Hi All

Can any on provide me BPSK modulation code with carrier over AWGN and demodulation m file.

looking for a positive response.

Regards,

ashfaq_nust@yahoo.com
 

bpsk.m

For QAMMOD:

QAMMOD Quadrature amplitude modulation
Y = QAMMOD(X,M) outputs the complex envelope of the modulation of the
message signal X using quadrature amplitude modulation. M is the
alphabet size and must be an integer power of two. The message signal
must consist of integers between 0 and M-1. The signal constellation is
a rectangular constellation. For two-dimensional signals, the function
treats each column as 1 channel.

For AWGN:

Function File: Y = awgn (X,SNR)
Function File: Y = awgn (X,SNR,PWR)
Function File: Y = awgn (X,SNR, PWR,SEED)
Function File: Y = awgn (..., 'TYPE')
Add white Gaussian noise to a voltage signal.

The input X is assumed to be a real or complex voltage signal. The
returned value Y will be the same form and size as X but with
Gaussian noise added. Unless the power is specified in PWR, the
signal power is assumed to be 0dBW, and the noise of SNR dB will be
added with respect to this. If PWR is a numeric value then the
signal X is assumed to be PWR dBW, otherwise if PWR is 'measured',
then the power in the signal will be measured and the noise added
relative to this measured power.

If SEED is specified, then the random number generator seed is
initialized with this value

By default the SNR and PWR are assumed to be in dB and dBW
respectively. This default behaviour can be chosen with TYPE set
to 'dB'. In the case where TYPE is set to 'linear', PWR is assumed
to be in Watts and SNR is a ratio.
 

m file for bpsk

this is the complete program my friend, see it below:

clc;
clear all;
disp('M-Array PSK Modulation')
%create a random digital message
M=input ('M= '); %alphabet size
x=randint(input('Number of binary bit stream = '),1,M);
nsample=40; %oversampling rate.
%use M-PSK modulation to produce y
y=modulate(modem.pskmod(M),x);
%%
%follow with rectangular pulse shaping.
ypulse=rectpulse(y,nsample);
stem(y(1:10),'filled'),grid;
%%
%%transmit signal through an AWGN Channel
ynoisy=awgn(ypulse,input('SNR in dB = '),'measured');
%%
%Create scattet plot from noisy data
scatterplot(ynoisy),grid;
%%
%Downsample at the reciever.
ydownsample=intdump(ynoisy,nsample);
%%
%Demodulate ynoisy to recover the message.
z=demodulate(modem.pskdemod(M),ydownsample);
figure;
subplot(2,1,1);
stem(x(1:10),'filled'),grid;
subplot(2,1,2);
stem(z(1:10),'filled'),grid;
%%
%Check symbole erroe rate.
[num ty]=symerr(x,z)

------------------------------------------------------------------------------
my friend,

this is a general program for M-psk, you can chose M =2 for BPSK or M=4 for QPSK or others.
 

bpsk m-file

hello mate,

i tried the program and it is not working for me. MATLAB gave me:

??? Undefined variable "modem" or class "modem.pskmod".

does it have to be modem function?? can I use something else to get it working??
can I take away the following: pulse shaping, downsample stages?? is it ok??

thanks in advance
 

binary-phase-shift-keying (bpsk) m-file

which matlab version u use? u must have matlab R2008
 

symerr.m

I have 2007 Matlab version. what iste diference and what can i do??
 

.m file for snr in matlab

see the code below, i get it from the help of a previous version

M = 16; % Use 16-ary modulation.
Fd = 1; % Assume the original message is sampled
% at a rate of 1 sample per second.
Fs = 3; % The modulated signal will be sampled
% at a rate of 3 samples per second.
x = randint(100,1,M); % Random digital message
% Use M-ary PSK modulation to produce y.
y = dmodce(x,Fd,Fs,'psk',M);
% Add some Gaussian noise.
ynoisy = y + .04*randn(300,1) + .04*j*randn(300,1);
% Create scatter plot from noisy data.
scatterplot(ynoisy,1,0,'b.');
% Demodulate y to recover the message.
z = ddemodce(ynoisy,Fd,Fs,'psk',M);
s = symerr(x,z) % Check symbol error rate.
57_1241870603.jpg
 

gaussian mfile

PLS SEND ME ON MY ID BPSK,QPSK,ND 16-QAM .M FILE MEANS MATLAB FILE PLS SEND ME....MY PROJECT ON BPSK ND QPSK...PLS HELP ME FAST..K ...THANKS A LOTS OF
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top