⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uwbbpsk.mht

📁 这是从英文网站上下载的程序
💻 MHT
📖 第 1 页 / 共 2 页
字号:
From: <由 Microsoft Internet Explorer 5 保存>
Subject: 
Date: Mon, 25 Jun 2007 10:55:37 +0800
MIME-Version: 1.0
Content-Type: text/html;
	charset="gb2312"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://www.mathworks.com/matlabcentral/files/6722/UWBBPSK.m
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dgb2312">
<META content=3D"MSHTML 6.00.2900.3086" name=3DGENERATOR></HEAD>
<BODY><PRE>%UWB-Run from editor debug(F5)-BPSK modulation and link =
analysis of
%UWB monocycle and doublet waveforms.Revised 1/2/05-JC
%This m file plots the time and frequency waveforms for BPSK 1st and 2nd =
derivative=20
%equations used in UWB system analysis. Adjustment factors are required =
to
%correct for inaccuracies in the 1st and 2nd derivative equations.
%Tail to tail on the time wave forms should be considered as the actual =
pulse width.=20
%7*PW1 has about 99.9% of the signal power. The frequency spreads and =
center=20
%frequencies(fc=3Dcenter of the spread)are correct as you can =
verify(fc~1/pw1).
%Change pw(adjustment factor)and t for other entered(pw1) pulse widths =
and
%zooming in on the waveforms.A basic correlation receiver is constructed
%with an integrator(low pass filter-uses impulse response)showing the =
demodulated output=20
%information from a comparator(10101). Perfect sync is assumed in the =
correlation receiver.
%Noise is added with a variance of 1 and a mean of 0.
%See SETUP and other info at end of program.
%The program is not considered to be the ultimate in UWB analysis, but =
is=20
%configured to show basic concepts of the new technology. I would =
suggest that
%you review the previous files I published in the Mathworks file =
exchange concerning
%UWB to enhance your understanding of this technology. PPM(pulse =
position
%modulation) was analyzed in earlier files. PPM is an orthogonal =
waveform=20
%and not as efficient as BPSK which is an antipodal waveform with =
helpful
%properties in UWB usage. My assumption in this analysis is that the =
transmitting antenna
%produces a 2nd derivative doublet and that the receiving antenna passes
%the doublet thru to the mixer without integrating or differentating the =
signal, leaving
%a doublet. I believe the doublet also has helpful properties in UWB
%systems. I have included a reference at the end which is a must read.
%=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
pw1=3D.2e-9;%pulse width in nanosec,change to desired width
pw=3Dpw1/1.24;%Adjustment factor for inaccurate PWs(approx. 3-5 for 1st =
der. and
%approx. 1-3 for 2nd der.)
Fs=3D100e9;%sample frequency
Fn=3DFs/2;%Nyquist frequency
t=3D-1e-9:1/Fs:30e-9;%time vector sampled at Fs Hertz. zoom in/out using =
(-1e-9:1/Fs:xxxx)
%=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =

% EQUATIONS
%=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
%y=3DA*(t/pw).*exp(-(t/pw).^2);%1st derivative of Gaussian =
pulse=3DGaussian monocycle
y =3D1*(1 - 4*pi.*((t)/pw).^2).* exp(-2*pi.*((t)/pw).^2);%2nd derivative =
of Gaussian
%pulse=3Ddoublet(two zero crossings)
%=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
%NOISE SETUP FOR BER AND SNR
%=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

noise=3D(1e-50)*(randn(size(t)));%Noise-AWGN(0.2 gives approx =
Eb/No=3DEs/No=3DSNR=3D 7DB)
%for 2 volt peak to peak BPSK signal.Set to 1e-50 to disable=20

%=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
%BPSK OR BI-PHASE MODULATION=20
%=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
%The following series of equations sets the pulse recurring =
frequency(PRF)
%at 156MHz(waveform repeats every 6.41e-9 sec and a
%modulated bit stream(bit rate=3D156Mb/s)of 10101 (5 pulses,can add =
more)
%where a {1=3D0 degrees(right side up) and a 1 bit} and a {-1=3D180
%degrees(upside down) a 0 bit.}
%One could expand the # of pulses and modulate for a series of
%111111000000111111000000111111 which would give a lower bit rate. You =
could just
%change the PRF also.This series of redundent pulses also improves the =
processing gain
%of the receiver(under certain conditions)by giving more voltage out of =
the integrator
%in a correlation receiver. The appropriate sequence when using BPSK can =
also produce=20
%nulls in the spectrum which would be useful for interference rejection =
or to keep
%the UWB spectrum from interfering with other communication systems.
%For loops or some other method could be used to generate these pulses =
but for
%myself, I would get lost. This is a brute force method and I can easily =
copy and paste.
%I will leave other methods for more energetic souls. Since we have the =
transmitter
%implemented it's time to move on to the correlation receiver design and =

%see if we can demodulate and get 10101 bits out at the 156Mb/s bit =
rate.=20

%=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
% 1ST DERIVATIVE MONOCYCLE(PPM WITH 5 PULSES)
%=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
%yp=3Dy+ ...
%A*((t-2.5e-9-.2e-9)/pw).*exp(-((t-2.5e-9-.2e-9)/pw).^2)+A*((t-5e-9)/pw).=
*exp(-((t-5e-9)/pw).^2)+ ...
%A*((t-7.5e-9-.2e-9)/pw).*exp(-((t-7.5e-9-.2e-9)/pw).^2)+A*((t-10e-9)/pw)=
.*exp(-((t-10e-9)/pw).^2);
%=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
% 2ND DERIVATIVE DOUBLET(BPSK) WITH 5 PULSES)
%=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
%BPSK modulated doublet(yp)
yp=3D1*y+ ...
-1*(1-4*pi.*((t-6.41e-9)/pw).^2).*exp(-2*pi.*((t-6.41e-9)/pw).^2)+ ...
1*(1-4*pi.*((t-12.82e-9)/pw).^2).*exp(-2*pi.*((t-12.82e-9)/pw).^2)+ ...
-1*(1-4*pi.*((t-19.23e-9)/pw).^2).*exp(-2*pi.*((t-19.23e-9)/pw).^2)+ ...
1*(1-4*pi.*((t-25.64e-9)/pw).^2).*exp(-2*pi.*((t-25.64e-9)/pw).^2);

%unmodulated doublet(yum)
B=3D1; =20
yum=3DB*y+ ...
B*(1-4*pi.*((t-6.41e-9)/pw).^2).*exp(-2*pi.*((t-6.41e-9)/pw).^2)+ ...
B*(1-4*pi.*((t-12.82e-9)/pw).^2).*exp(-2*pi.*((t-12.82e-9)/pw).^2)+ ...
B*(1-4*pi.*((t-19.23e-9)/pw).^2).*exp(-2*pi.*((t-19.23e-9)/pw).^2)+ ...
B*(1-4*pi.*((t-25.64e-9)/pw).^2).*exp(-2*pi.*((t-25.64e-9)/pw).^2);

ym=3Dyp+noise;%BPSK modulated doublet with noise

yc=3Dym.*yum;%yc(correlated output)=3Dym(modulated)times =
yum(unmodulated) doublet.
%This is where the correlation occurs in the receiver and would be the
%mixer in the receiver.=20
%=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
% FFT
%=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
%new FFT for BPSK modulated doublet(ym)
NFFYM=3D2.^(ceil(log(length(ym))/log(2)));
FFTYM=3Dfft(ym,NFFYM);%pad with zeros
NumUniquePts=3Dceil((NFFYM+1)/2);=20
FFTYM=3DFFTYM(1:NumUniquePts);
MYM=3Dabs(FFTYM);
MYM=3DMYM*2;
MYM(1)=3DMYM(1)/2;
MYM(length(MYM))=3DMYM(length(MYM))/2;
MYM=3DMYM/length(ym);
f=3D(0:NumUniquePts-1)*2*Fn/NFFYM;

%new FFT for unmodulated doublet(yum)
NFFYUM=3D2.^(ceil(log(length(yum))/log(2)));
FFTYUM=3Dfft(yum,NFFYUM);%pad with zeros
NumUniquePts=3Dceil((NFFYUM+1)/2);=20
FFTYUM=3DFFTYUM(1:NumUniquePts);
MYUM=3Dabs(FFTYUM);
MYUM=3DMYUM*2;
MYUM(1)=3DMYUM(1)/2;
MYUM(length(MYUM))=3DMYUM(length(MYUM))/2;
MYUM=3DMYUM/length(yum);
f=3D(0:NumUniquePts-1)*2*Fn/NFFYUM;

%new FFT for correlated pulses(yc)
%yc is the time domain signal output of the multiplier
%(modulated times unmodulated) in the correlation receiver. Plots=20
%in the time domain show that a simple comparator instead of high speed =
A/D's=20
%may be used to recover the 10101 signal depending on integrator design =
and level of
%peak voltage into mixer.
NFFYC=3D2.^(ceil(log(length(yc))/log(2)));
FFTYC=3Dfft(yc,NFFYC);%pad with zeros
NumUniquePts=3Dceil((NFFYC+1)/2);=20
FFTYC=3DFFTYC(1:NumUniquePts);
MYC=3Dabs(FFTYC);
MYC=3DMYC*2;
MYC(1)=3DMYC(1)/2;
MYC(length(MYC))=3DMYC(length(MYC))/2;
MYC=3DMYC/length(yc);
f=3D(0:NumUniquePts-1)*2*Fn/NFFYC;

%=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
% PLOTS
%=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
%plots for modulated doublet(ym)
figure(1)
subplot(2,2,1); plot(t,ym);xlabel('TIME');ylabel('AMPLITUDE');
title('Modulated pulse train');
grid on;
%axis([-1e-9,27e-9 -1 2])
subplot(2,2,2); plot(f,MYM);xlabel('FREQUENCY');ylabel('AMPLITUDE');
%axis([0 10e9 0 .1]);%zoom in/out
grid on;
subplot(2,2,3); =
plot(f,20*log10(MYM));xlabel('FREQUENCY');ylabel('20LOG10=3DDB');
%axis([0 20e9 -120 0]);
grid on;

%plots for unmodulated doublet(yum)
figure(2)
subplot(2,2,1); plot(t,yum);xlabel('TIME');ylabel('AMPLITUDE');
title('Unmodulated pulse train');
grid on;
axis([-1e-9,27e-9 -1 1])
subplot(2,2,2); plot(f,MYUM);xlabel('FREQUENCY');ylabel('AMPLITUDE');
axis([0 10e9 0 .1]);%zoom in/out
grid on;
subplot(2,2,3); =
plot(f,20*log10(MYUM));xlabel('FREQUENCY');ylabel('20LOG10=3DDB');
%axis([0 20e9 -120 0]);
grid on;

%plots for correlated pulses(yc)
figure(3)
subplot(2,2,1); plot(t,yc);xlabel('TIME');ylabel('AMPLITUDE');
title('Receiver correlator output-no LPF');
grid on;
%axis([-1e-9,27e-9 -1 1])
subplot(2,2,2); plot(f,MYC);xlabel('FREQUENCY');ylabel('AMPLITUDE');
%axis([0 7e9 0 .025]);%zoom in/out
grid on;
subplot(2,2,3); =
plot(f,20*log10(MYC));xlabel('FREQUENCY');ylabel('20LOG10=3DDB');
%axis([0 20e9 -120 0]);
grid on;
%=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
%CORRELATION RECEIVER COMPARATOR(before lowpass filter)
%=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
pt=3D.5%sets level where threshhold device comparator triggers
H=3D5;%(volts)
L=3D0;%(volts)
LEN=3Dlength(yc);
for ii=3D1:LEN;
    if yc(ii)&gt;=3Dpt;%correlated output(y2) going above pt threshold =
setting
        pv(ii)=3DH;%pulse voltage
    else;
        pv(ii)=3DL;
    end;
end ;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -