کد متلب سیگنال مدولاسیونBPSK
function squarefig(tb,ts,fc)
tb=input('tb=')
ts=input('ts=')
fc=input('fc=')
% k=randint(1,16)
k=[0 1 0 1]
t=0:ts:tb;
pulse1=[]
pulse2=[]
y=[]
time=[]
for i=1:length(k)
if k(i)== 0
bit0=zeros(1,length(t))
pulse1=[pulse1 bit0]
elseif k(i)==1
bit1=ones(1,length(t))
pulse1=[pulse1 bit1]
end
if k(i)==0
bit2=cos(2*pi*fc*t)
pulse2=[pulse2 bit2]
elseif k(i)==1
bit3=-cos(2*pi*fc*t)
pulse2=[pulse2 bit3]
end
y=[y cos(2*pi*fc*t)]
time=[time t]
t=t+tb
end
subplot(3,1,1)
plot(time,pulse1)
subplot(3,1,2)
plot(time,pulse2)
subplot(3,1,3)
plot(time,y)
axis([0 8 -3 3])
tb=input('tb=')
ts=input('ts=')
fc=input('fc=')
% k=randint(1,16)
k=[0 1 0 1]
t=0:ts:tb;
pulse1=[]
pulse2=[]
y=[]
time=[]
for i=1:length(k)
if k(i)== 0
bit0=zeros(1,length(t))
pulse1=[pulse1 bit0]
elseif k(i)==1
bit1=ones(1,length(t))
pulse1=[pulse1 bit1]
end
if k(i)==0
bit2=cos(2*pi*fc*t)
pulse2=[pulse2 bit2]
elseif k(i)==1
bit3=-cos(2*pi*fc*t)
pulse2=[pulse2 bit3]
end
y=[y cos(2*pi*fc*t)]
time=[time t]
t=t+tb
end
subplot(3,1,1)
plot(time,pulse1)
subplot(3,1,2)
plot(time,pulse2)
subplot(3,1,3)
plot(time,y)
axis([0 8 -3 3])
+ نوشته شده در سه شنبه ۱۲ دی ۱۳۹۱ ساعت 5:52 PM توسط nourollah joya
|
مقدم شما عزیزان را به "جویابرق" ارج مینهیم ،این وبلاگ جهت "جستوجو "و ارائه مقالات وپروژهای علمی در زمینه "اقیانوس عظیم برق "درست گردیده ،تا هم اهالی این رشته بزرگ و مهم فنی و مهندسی از آن استفاده کنند .وهم از علم و تجارب استادان ،اندیشمندان،مهندسان،دانشجویان و کاربران این اقیانوس بزرگ بهره جست.در پایان "جویابرق"بیصبرانه منتظر نقطه نظرات و پیشنهادهای شما دوستان گرامی است .که موجب خوشحالی ما وتشکرازشما می گردد…!