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

📄 uwb_tx_rx.mht

📁 uwb receiver and transceiver with matlab
💻 MHT
字号:
From: <Microsoft Internet Explorer 5 ile kaydedildi>
Subject: 
Date: Wed, 18 Feb 2009 21:21:19 +0200
MIME-Version: 1.0
Content-Type: text/html;
	charset="windows-1254"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://www.mathworks.com/matlabcentral/fx_files/19111/1/UWB_TX_RX.m
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1254">
<META content=3D"MSHTML 6.00.2900.3492" name=3DGENERATOR></HEAD>
<BODY><PRE>%JC 3/7/08
%UWB Transmitter/Receiver using BPSK Continuous Wave
%Run from editor debug(F5).
%m-file uses random data which BPSK modulates a
%carrier to construct a  BPSK UWB transmitter. The receiver demodulates =
the BPSK UWB
%signal (assumming perfect sync) and the filtered data is recovered.
%NOTE:You should assume that the variables are multiplied by ONE MILLION =
to theoritically
%give values such as fcarr=3D4.0GHz,N=3D1.3GHz and so on. The numbers =
shown here, when
%upscaled, signify pulse widths of ~ 750 pico seconds (1/1.3GHz). In =
other words, what
%I'm trying to say is you have a system that can operate in the 3.1-10.6 =
GHz
%UWB band(at data rates up to 1.3 Gbps) by changing fcarr and the =
bandwidth can be changed
%by varing the time of the data rate or N. It would be nice to do this =
in real time with=20
%multipath, FEC, PLL's etc, but we do with what we have. Another thought =
would be to use=20
%a QPSK format to increase the data rate. I have provided references at =
the end of this
%file. They should give you a good idea of this particuliar technique =
and some possible
%differences between it and impulse response UWB and MB-OFDM UWB. The =
program is somewhat
%rudimentary but I hope it is clear enough to be helpful.

clear;
fcarr=3D4e3;              % Carrier frequency
N =3D 1300;		        % Number of symbols (data rate)
fs =3D 15.6*1e3;		    % Sampling frequency
Fn =3D fs/2;              % Nyquist frequency
Ts =3D 1/fs;	            % Sampling time =3D 1/fs
T =3D 1/N;		        % Symbol time
randn('state',0);       % Keeps transmitted data from changing on reruns
t =3D [0:Ts:(1-Ts)];      % Time vector
%=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DTransmitter=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
symbols =3D sign(randn(N,1))';%generate N random binary symbols(data), =
+/- 1
%(notice transpose')
symbols1 =3D ones(T/Ts,1)*symbols;
s2 =3D symbols1(:); 	%data @ +/-1

%generate carrier wave
%sine wave
%2 pi fc t is written as below
twopi_fc_t=3D(1:fs)*2*pi*fcarr/fs;=20
a=3D2;  %set amplitude
f_c =3D a * sin(twopi_fc_t); %unmodulated carrier frequency
%=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
s2=3Ds2';            %transpose for matrix match

f_c1=3Df_c.*s2;     %multiply carrier and +/- signal data to get =
modulated BPSK carrier
%At this point in the transmitter you would add a bandpass filter to =
meet
%FCC UWB spectral mask of -41.25 dBm/MHz EIRP.

%=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
%take FFT of modulated carrier(f_c1) [spectrum analyzer]
y=3Df_c1;
NFFY=3D2.^(ceil(log(length(y))/log(2)));
FFTY=3Dfft(y,NFFY);%pad with zeros
NumUniquePts=3Dceil((NFFY+1)/2);=20
FFTY=3DFFTY(1:NumUniquePts);
MY=3Dabs(FFTY);
MY=3DMY*2;
MY(1)=3DMY(1)/2;
MY(length(MY))=3DMY(length(MY))/2;
MY=3DMY/length(y);
f1=3D(0:NumUniquePts-1)*2*Fn/NFFY;

%plot frequency domain
subplot(3,2,4); plot(f1,MY);xlabel('');ylabel('AMPLITUDE');
axis([0 8000 -.5 .5]);%zoom in/out
title('FREQUENCY DOMAIN PLOTS');
grid on;
subplot(3,2,6); =
plot(f1,20*log10(abs(MY).^2));xlabel('FREQUENCY(MHz)');ylabel('DB');
axis([0 8000 -100 -20]);
grid on;
title(' UNFILTERED BPSK MODULATED UWB SIGNAL ')

%plot data [ocilloscope-time domain]
figure(1)
subplot(3,2,1)
plot(t,s2)
axis([0 4.5e-3 -1.2 1.2])
grid on
title('TRANSMITTED DATA')

subplot(3,2,3)=20
plot(t,f_c1)
axis([0 4.5e-3 -4 4])
grid on
title('MODULATOR OUT 0/180 DEGREE PHASE SHIFTS ')

subplot(3,2,5)=20
plot(t,f_c)
axis([0 4.5e-3 -4 4])
grid on
title('CARRIER FREQUENCY')

%=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DReceiver=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
%Assume perfect sync
data1=3Df_c.*f_c1; %multiply carrier with modulated output
%At this point in the receiver, you would add a low pass filter and use =
a
%one to three bit flash ADC as the signal level will be quiet small=20
%(depending on distance)even with a low noise pre amp.
subplot(3,2,2)
plot(t,data1)
axis([0 4.5e-3 -5.2 5.2])
grid on
title('UNFILTERED RECEIVED DATA')

%References
%http://www.mwee.com/590028720 "All Ultra-Wideband (UWB) systems are not
%created equal"
%http://electronicdesign.com   "Third UWB Method Solves The Home Network
%Problem"
%http://www.wirelessnetdesignline.com  "Comprehensive UWB product =
testing"

</PRE></BODY></HTML>

⌨️ 快捷键说明

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