?? findfrm.m
字號:
function FrameStart= findfrm(SignalIn, FrameGap, quickrate,zerotime)
%FINDFRM Finds the start of a COFDM frame
% FrameStart = findfrm(SignalIn, FrameGap, quickrate,zerotime)
% Find the approximate starting location
% zerotime : zeroed time of the guard period
% Copyright Eric Lawrey 1997
%
SignalIn = abs(SignalIn); %Envelope detect the signal
%=========================================
% Subsample to find approx start location
%=========================================
index = 1:quickrate:length(SignalIn);
SubSignal = SignalIn(index); %Subsample the signal
SubFilt = filter(ones(1,(FrameGap/quickrate)),1,SubSignal);
SearchSig1 = SubFilt(FrameGap/quickrate:length(SubFilt));
approxstart = min((find(SearchSig1==min(SearchSig1))+...
FrameGap/quickrate)*quickrate-zerotime);
%plot(SearchSig1);
%============================================================
% Narrow down the search to find the exact starting location
%============================================================
Offset = approxstart-1.1*FrameGap; %Starting location of accurate search
EnvFilt = filter(ones(1,FrameGap),1,...
SignalIn(Offset:approxstart+FrameGap/3));
%plot(EnvFilt);
%============================================================================
%Find the minimum of the integral ensuring that it is at least one frame time
%before the end of the wave file. (ignore the first symbol period)
%============================================================================
SearchSig = EnvFilt(FrameGap:length(EnvFilt));
minsig = find(SearchSig==min(SearchSig))+FrameGap;
%Calc the expect start of the frame
%Pick the frame start just before the normal starting time to allow for timming
%errors in both directions, i.e. early and late
FrameStart = min(minsig-zerotime+Offset);
CalcStart = FrameStart;
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -