2 Kommentare

James Tursa
James Tursa am 30 Mär. 2021
In the future, always post your code as text highlighted by the CODE button. Do not post your code as images because we can't copy & run pictures.
Kwan Ho NG
Kwan Ho NG am 30 Mär. 2021
clear;
fs=10^4;
fc=1000; %carrier frequency
T=16*(1/500); %1/500 is the bit duration; 16bits data
Ts=1/fs; %Ts is the sampling duration for a given frequency = 0.0001s
N=T/Ts; %total number of samples for the 16 bit data
sin_wave= sin(2*pi*fc*(0:Ts:(N-1)*Ts));
cos_wave= cos(2*pi*fc*(0:Ts:(N-1)*Ts));
Ns=40;
data_I=[1 1 1 1 1 -1 1 -1];
data_Q=[-1 -1 1 1 -1 1 -1 -1];
sum_unm=8;
for i=1:sum_unm
for j=1:Ns
data_I_exit((i-1)*Ns+j))=data_I(i);
data_Q_exit((i-1)*Ns+j))=data_Q(i);
end;
end;
for i=1:N
out_QPSK(i)=data_I_exit(i)*cos_wave(i)+data_I_exit(i)+cos_wave(i);
end;
x=0:Ts:T-Ts
plot(x,out_QPSK)

Melden Sie sich an, um zu kommentieren.

Antworten (1)

James Tursa
James Tursa am 30 Mär. 2021

0 Stimmen

Delete the extra closing parentheses. I.e., delete the paren where the red underline is.

Kategorien

Mehr zu Electrical Block Libraries finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 30 Mär. 2021

Kommentiert:

am 30 Mär. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by