亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? bpsk_ask.m

?? 分析了ASK和BPSK通信系統,接收機采用相關器接收分析系統測試和理論誤碼率
?? M
字號:
%Run from editor Debug(F)
%This m file(ASK.m) analyzes a coherent amplitute shift keyed(ASK) and a binary
%phase shift keyed(BPSK) communication system. The receiver uses a correlator
%(mixer-integrator [lpf]) configuration with BER measurements comparing measured
%and theoretical results. The band pass and low pass filters used in the receiver are
%constructed using z transforms. M files on BPF and LPF design using z
%transforms can be found in the author index (CJ) mathworks file exchange. A fundemental 
%question to ask is: "Why does BPSK show a 3dB improvement(as you will see using the 
%program)in BER over ASK?". A simple answer is that the signal for ASK is being
%transmitted only half the time. A reference is provided at the end of the program that
%was used in writing the program. Always remember a journey of a thousand
%miles requires a first one small step.
%========================================
% Set universal parameters
% =======================================
clear
fs=8e5;%sampling frequency
fm=20e3;%square wave modulating frequency(NRZ)= 40KHz bit rate
n=2*(6*fs/fm);
final=(1/fs)*(n-1);
fc=2e5; % carrier frequency
t=0:1/fs:(final);
Fn=fs/2;%nyquist frequency
%=========================================
%Generate square wave by using cosine wave
%==========================================
% cosine wave
% 2 pi fc t is written as below
twopi_fc_t=2*pi*fm*t; 
A=1;
phi=0;
x = A * cos(twopi_fc_t + phi);
x1=x;
% square wave
am=1;
x(x>0)=am;
%x(x<0)=0;%use for ASK-comment out BPSK
x(x<0)=-1;%use for BPSK-remember ASK variables become BPSK

subplot(321);
plot(t,x);
axis([1e-4 3e-4 -2 2]);
title('Square Wave Modulating Input To Transmitter');
grid on

car=sin(2*pi*fc*t);%Sinewave carrier waveform
ask=x.*car;%modulate carrier(ASK or BPSK)

subplot(322);
plot(t,ask);
axis([0 100e-6 -2 2]);
title('Modulated Sinewave Carrier Waveform');
grid on;
%=====================================================
%Noise generator SNR=Eb/No=20log(Signalrms/Noiserms)
%======================================================
%vn=0;
vn=0.1;%set noise level 0.1~=6db=SNR=Eb/No
noise=vn*(randn(size(t)));%noise generator
subplot(323);
plot(t,noise);
grid on;
title('Noise Level');
axis([0 .6e-3 -1 1]);


askn=(ask+noise);%modulated carrier plus noise
subplot(324);
plot(t,askn);
axis([0 100e-6 -2 2]);
title('Modulated Carrier Waveform Plus Noise');
grid on;

%======================================================================
%Receiver bandpass filter(two poles two zeros) 
%======================================================================
fBW=40e3;
f=[0:3e3:4e5];
w=2*pi*f/fs;
z=exp(w*j);
BW=2*pi*fBW/fs;
a=.8547;%BW=2(1-a)/sqrt(a)
p=(j^2*a^2);
gain=.135;
Hz=gain*(z+1).*(z-1)./(z.^2-(p));

subplot(325);
plot(f,abs(Hz));
title('Receiver Bandpass Filter Response');
grid on;


Hz(Hz==0)=10^(8);%avoid log(0)
subplot(326);
plot(f,20*log10(abs(Hz)));
grid on;
title('Receiver -3dB Filter Response');
axis([1e5 3e5 -3 1]);

%filter coefficients
a=[1 0 .7305];%[1 0 p]
b=[.135 0 -.135];%gain*[1 0 -1]
faskn=filter(b,a,askn);
figure;
subplot(321);
plot(t,faskn);
axis([0 100e-6 -2 2]);
title('Receiver BPF Output');
grid on;


cm=faskn.*car;%multiply modulated carrier with unmodulated carrier
subplot(322);
plot(t,cm);
axis([0 100e-6 -2 2]);
grid on;
title('Receiver Multiplier Output');

%===================================================================
%Low pass filter(one pole one zero)
%==================================================================
p=.72;
gain1=.14;%gain=(1-p)/2
Hz1=gain1*(z+1)./(z-(p));
%0.65=53KHz
%0.7=45KHz
%0.72=40KHZ=best for lowest BER-Theory says set equal to the bit rate
%0.75=37KHz
%0.8=28KHz

%subplot(323);
%plot(f,abs(Hz1));
%title('Receiver LPF Response');
%grid on;

subplot(323);
Hz1(Hz1==0)=10^(-8);%avoid log(0)
plot(f,20*log10(abs(Hz1)));
grid on;
title('LPF -3dB response');
axis([0 5e4 -3 1]);

%filter coefficients
a1=[1 -.72];%(z-(p))
b1=[.14 .14];%gain*[1 1]

so=filter(b1,a1,cm);
so=so*10;%add gain
so=so-mean(so);%removes DC component
subplot(324);
plot(t,so);
axis([1e-4 3e-4 -2.5 2.5]);
title('Receiver Output Signal-LPF');
grid on;
%======================================================
%Comparator
%======================================================
High=2.5;
Low=-2.5;
vt=0;%sets comparator threshold
error=0;
%calculate the number of elements in matrix so, the output of the filter
len1=length(so); %number of elements in so
for ii=1:len1
  if so(ii) >= vt
  Vs(ii)=High;
  else
  Vs(ii)=Low;
  end
end
Vo=Vs+2.5;
subplot(325);
plot (t,Vo), title('Receiver Regenerated signal'),
axis([1e-4 3e-4 -8 8])
grid on;
xlabel('Time (s)'), ylabel('Magnitude(V)'),
%========================================================
%Generate delayed squarewave
%=========================================================
%cosine wave delayed to match receiver regenerated signal square waves.
%filters have delay
% 2 pi fc t is written as below
twopi_fc_t1=2*pi*fm*(t-.59e-4);%adds delay 
%A=1;
phi1=0;
x1 = A * cos(twopi_fc_t1 + phi1);

% square wave
x1(x1>0)=am;
x1(x1<0)=0;

sr=x1;
sf=5*sr;
subplot(326);
plot (t,sf), title('Input signal-delayed'),
axis([1e-4 3e-4 -8 8]);
grid on;
xlabel('Time (s)'), ylabel('Magnitude(V)'),

a=5*xor(sf,Vo); %show where errors occur against time.
figure(3);
plot (t,a), title('Error pulses'),
axis([0 8e-4 -8 8]);
grid on;
xlabel('Time (s)'), ylabel('Magnitude(V)'),
  %for ii=1:len1;
  for ii=20:1:len1%during startup,errors are generated. The first 20 samples of len1
                  %(480 samples) are bypassed and no noise gives zero errors. 480-20=460 
  if sf(ii) ~= Vo(ii) % if output and input are not the same then increment error
  error=error+1;
  end
end
error %display number of errors

figure(4);
err=[0 0 0 0 0 0 error/460 0 0];%Measured at different values of SNR by setting vn
snr=10.^ ( [0:0.1:12]./10);
Pb= 0.5*erfc(.707*sqrt(snr)); % BER (Theoretical-ASK)
Pb1= 0.5*erfc(sqrt(snr)); % BER (Theoretical-BPSK)
semilogy([0:8],err,'*',[0:0.1:12],Pb,'-',[0:0.1:12],Pb1,'--'); % plot
grid on; xlabel('SNR=Eb/No(dB)'); ylabel('BER');
title('Simulation of BER for ASK and BPSK');
legend('BER','ASK Theoretical','BPSK Theoretical');
BER=error/460%display BER
%Could have set up a for loop using vn to calculate all points(err) but would
%complicate matters.Easier to run by hand and observe BER plot. Presently
%set for SNR=6dB.
%===================================================
%Frequency domain plots
%====================================================
%Lets take a look at askn(unfiltered carrier + noise) and
%faskn(band pass filtered carrier + noise) output on a spectrum analyzer.
%This fft code is somewhat complex but comes from the mathworks. Works
%great as it shows one what they would actually see using a spectrum analyzer.

%y=askn;%unfiltered carrier + noise 
y=faskn;%band pass filtered carrier + noise
NFFY=2.^(ceil(log(length(y))/log(2)));
FFTY=fft(y,NFFY);%pad with zeros
NumUniquePts=ceil((NFFY+1)/2); 
FFTY=FFTY(1:NumUniquePts);
MY=abs(FFTY);
MY=MY*2;
MY(1)=MY(1)/2;
MY(length(MY))=MY(length(MY))/2;
MY=MY/length(y);
f1=(0:NumUniquePts-1)*2*Fn/NFFY;

figure(5)
subplot(2,2,1); plot(f1,MY);xlabel('FREQUENCY');ylabel('AMPLITUDE');
axis([0 3e5 -.5 1]);%zoom in/out
title('Modulated Tx carrier plus noise');
grid on;
subplot(2,2,2); plot(f1,20*log10(abs(MY).^2));xlabel('FREQUENCY');ylabel('DB');
axis([0 3e5 -60 5]);
grid on;
title('Frequency domain plots')

%Reference
%http://soe.unn.ac.uk/ocr/people/ghassemlooy/
%Prof. Z Ghassemlooy's website
%Good site for theory and m files. I structured this m file from his work
%and have added a few things. I constructed filters using z transforms
%since I don't have the filter toolbox functions.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区精品久久99| 欧美日韩国产a| 8v天堂国产在线一区二区| 国产日韩成人精品| 日韩专区在线视频| 91在线视频18| 国产亚洲精久久久久久| 轻轻草成人在线| 欧美色精品天天在线观看视频| 国产欧美久久久精品影院| 日本不卡视频一二三区| 色综合久久综合网97色综合 | 中文字幕日韩一区| 免费在线一区观看| 欧美日韩国产不卡| 亚洲午夜羞羞片| 色婷婷av久久久久久久| 中文字幕精品一区二区精品绿巨人 | 日韩欧美视频在线 | 一区二区三区91| 成人动漫中文字幕| 久久精品人人爽人人爽| 国产在线麻豆精品观看| 日韩欧美色综合| 麻豆久久一区二区| 欧美二区乱c少妇| 亚洲成av人片www| 欧美日韩色综合| 亚洲国产aⅴ天堂久久| 91网站最新网址| 成人欧美一区二区三区| 91女厕偷拍女厕偷拍高清| 欧美激情资源网| av爱爱亚洲一区| 亚洲男同性视频| 色国产精品一区在线观看| 日韩理论电影院| 91久久精品一区二区| 一区二区三区鲁丝不卡| 欧美四级电影在线观看| 亚洲第一搞黄网站| 欧美精品日韩综合在线| 久久精品72免费观看| 精品国产99国产精品| 国产精品12区| 国产精品伦理一区二区| 在线免费观看日本一区| 亚洲成人自拍一区| 欧美成人女星排名| 春色校园综合激情亚洲| 最新日韩av在线| 欧美午夜精品一区| 麻豆精品视频在线观看视频| 久久你懂得1024| 91色porny在线视频| 水野朝阳av一区二区三区| 精品国一区二区三区| 成人福利在线看| 亚洲午夜一区二区三区| 精品理论电影在线| 成人app网站| 午夜精品久久久久久| 久久尤物电影视频在线观看| 91丨porny丨在线| 免费一级片91| 亚洲欧美视频一区| 欧美一级艳片视频免费观看| 国产91色综合久久免费分享| 亚洲一区二区三区激情| 欧美精品一区二区三区一线天视频| 成人av在线播放网址| 日日夜夜一区二区| 中文字幕精品综合| 日韩一区二区中文字幕| k8久久久一区二区三区| 日本成人在线网站| 国产精品欧美极品| 日韩视频在线观看一区二区| 99精品视频一区| 国产一区二区三区日韩| 亚洲激情图片qvod| 久久久.com| 91麻豆精品国产91久久久| 97se亚洲国产综合自在线观| 久久成人免费网站| 亚洲大片一区二区三区| 亚洲欧美中日韩| 久久久精品免费观看| 欧美精品精品一区| 91色乱码一区二区三区| 国产福利91精品一区二区三区| 亚洲成人免费av| 最新热久久免费视频| 国产欧美日韩在线观看| 欧美一级久久久| 欧美亚男人的天堂| 不卡欧美aaaaa| 国产成人免费网站| 精品一二三四在线| 日韩国产精品大片| 丝瓜av网站精品一区二区| 亚洲伦理在线精品| 国产精品福利av| 国产欧美精品一区二区三区四区| 欧美大片免费久久精品三p| 欧美日韩亚洲不卡| 一本到三区不卡视频| 91小视频在线观看| 国产成人一区在线| 国产成人av一区| 国产一区999| 国产成人综合网站| 丰满放荡岳乱妇91ww| 激情六月婷婷综合| 国模一区二区三区白浆| 精品一区二区三区久久| 久久精品国产免费| 国产在线播精品第三| 国产麻豆精品95视频| 国产91高潮流白浆在线麻豆| 国产精品18久久久久久久久 | 亚洲精品一二三四区| 中文字幕日韩av资源站| 亚洲欧美aⅴ...| 亚洲日本va午夜在线影院| 亚洲精品国产无天堂网2021| 一区二区三区欧美亚洲| 亚洲一区二区在线观看视频 | 亚洲高清免费观看 | 一二三四社区欧美黄| 亚洲一区二区三区四区的| 香蕉久久一区二区不卡无毒影院| 三级久久三级久久久| 九色porny丨国产精品| 国产精品888| 一本色道久久综合亚洲91| 精品视频一区三区九区| 日韩亚洲电影在线| 日韩亚洲欧美一区| 久久精品一二三| 日韩一区在线看| 视频一区中文字幕| 国产一区二区福利视频| 91麻豆高清视频| 欧美一区二区三区系列电影| 久久久天堂av| 亚洲精品视频免费观看| 日日夜夜免费精品| 国产成a人亚洲| 精品视频全国免费看| 精品国产露脸精彩对白| 亚洲色图欧洲色图婷婷| 卡一卡二国产精品| 成人av动漫网站| 日韩色在线观看| 国产精品丝袜久久久久久app| 性久久久久久久| av网站一区二区三区| 日韩精品专区在线影院重磅| 国产精品高清亚洲| 精品亚洲免费视频| 337p亚洲精品色噜噜噜| 久久精品日韩一区二区三区| 亚洲成人精品在线观看| www.激情成人| 久久久久久久网| 美女一区二区三区| 欧美偷拍一区二区| 国产精品第13页| 国产一区二区按摩在线观看| 宅男噜噜噜66一区二区66| 国产精品传媒视频| 国产在线视频一区二区| 69堂精品视频| 最近中文字幕一区二区三区| 久久成人免费网| 99re亚洲国产精品| 国产精品午夜在线| 视频一区免费在线观看| 国内外成人在线视频| 色先锋aa成人| 国产欧美精品区一区二区三区 | 国产日韩精品一区二区浪潮av| 亚洲午夜精品17c| 色欲综合视频天天天| 久久久精品黄色| 日韩国产在线观看一区| 99精品国产99久久久久久白柏| 日韩女优av电影| 亚洲人成网站色在线观看| 蜜臀精品久久久久久蜜臀| 欧美一区二区三区色| 亚洲精品一二三| 懂色av一区二区三区免费观看 | 国产精品嫩草99a| 美女网站在线免费欧美精品| 欧美日韩一卡二卡三卡 | 欧美国产精品v| 国产成人精品网址| 欧美r级在线观看|