📄 receivefilter.m
字号:
% ------------------------------------------------------------------------------------------------------%
% ReceiveFilter(..) - The 'Matched Filter' used in DigiComm.
% -----------------------------------------------------------
% This is usually the matched filter used in digital communication systems, but with the flexibility
% that the actual filter coeffecients can be specified in the routine. This filter does two things :
% 1. Does the filtering of the actual received waveform using the filter coefficients specified.
% 2. Does the Sampling of the waveform at each signalling interval to retrieve the I and Q symbols.
%
% Inputs :
% ---------
% I_RxWaveform, Q_RxWaveform - The I and Q received waveforms.
% hReceiveFilter - The FIR filter coefficients used to perform 'matched' filtering. (usually this will
% be the same as the transmit filter coeffients inorder to enable matched filtering).
% numSamplesPerSymbol - The number of samples used to represent a symbol. This will be useful for
% sampling the filtered waveform.
%
% Outputs :
% -----------
% I_Symbols, Q_Symbols - The Received I and Q symbols.
%
% ------------------------------------------------------------------------------------------------------%
function [I_RxSymbols,Q_RxSymbols] = ReceiveFilter(I_RxWaveform,Q_RxWaveform,hReceiveFilter,numSamplesPerSymbol)
% Do the matched filtering first.
I_FilterOutput = conv(I_RxWaveform,hReceiveFilter);
Q_FilterOutput = conv(Q_RxWaveform,hReceiveFilter);
% It's assumed here that the transmit and the receive filters are of the same length.
% In actual it is ((Nt+Nr-1)-1)/2 = (Nt-1) = (Nr-1) (if Nt = Nr).
N_FilterTrailer = length(hReceiveFilter)-1;
% Convert to a symbol stream, taking into account the trailers due to the transmit and
% receive filter impulse responses.
SymbolRange = N_FilterTrailer+1:length(I_FilterOutput)-N_FilterTrailer;
I_RxSymbols = WaveformToSymbol(I_FilterOutput(SymbolRange),numSamplesPerSymbol);
Q_RxSymbols = WaveformToSymbol(Q_FilterOutput(SymbolRange),numSamplesPerSymbol);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -