Simple baseband TRx design concept in matlab
7 ビュー (過去 30 日間)
I am trying some experiments on how to process the data through wireless communication with the simple communication link below.
Source (bit stream) > Tx modulator > Tx filter > AWGN channel > Rx filter > Rx demodulator > Receiver bit (bit stream)
So, my expectation is that the receiver site should demod and receive the correct data from the source.
Example: Input data "111100001111"; the receiver should demod the data as "111100001111".
Anyway, what I got when I checked the output demoded message was that the data was not the same as the input.
Example: Input "111100001111"; demod data : "111000011111" which has an error on bit no 4 and bit no 8
Below are the matlab code and input parameters that I set on my experiments.
load("Data.mat") % Input data
numBits = length(B4mod_bit);
modOrder = 2; % for BPSK
bitsPerSymbol = log2(modOrder) % modOrder = 2^bitsPerSymbol
txFilt = comm.RaisedCosineTransmitFilter; % create Tx Raised Cosine Object
rxFilt = comm.RaisedCosineReceiveFilter; % create Rx Raised Cosine Object
dbpskmod = comm.DBPSKModulator(pi); % create dbpsk modulation object
dpbpskdemod = comm .DBPSKDemodulator(pi,"OutputDataType","Full precision"); % create dbpsk demodulation object
modOut = dbpskmod(B4mod_bit); %modulate input bits
txFiltOut = txFilt(modOut); % add tx filter after modulate
SNR = 35; % dB
chanOut = awgn(txFiltOut,SNR,"measured"); % add awgn channel
rxFiltOut = rxFilt(chanOut); % filter the receive signal
demodOut = dpbpskdemod(rxFiltOut) % demod the signal
numofBitErrors=nnz(B4mod_bit ~= demodOut) % compare Input and demod output here
% calculate the bit error rate follow from Wireless communication On ramp excersise
delayInBits=delayInSymbols * bitsPerSymbol
numBitErrors=nnz(srcAligned ~= demodAligned)
Source bit / Bit per frame : 208 bits
Modulation type : DBPSK with Pi phase rotation
bit rate / Symbol rate : 1 bps
Tx filter :
Shape: 'Square root'
Rx filter :
Shape: 'Square root'
Can anyone please give me some idea what is happening?
Any feedback is appreciated.
回答 (1 件)
Santosh Fatale 2022 年 11 月 24 日
It is my understanding that you are talking about the mismatch happening for the variable "numofBitErrors". Note that each of the Tx and Rx filters introduces a delay of (Filter Span in Symbol/2) * (Number of Bits/Symbol). You should not compare modulated and demodulated bits without taking the respective delay into account.
The same delay factor is taken into consideration in the second part of the code, where you followed the bit error calculation as per the Wireless Communication Onramp exercise.
You can also check out the following MATLAB Answer for more information on end-to-end implementation of wireless communication systems.