📄 down_sampler.m
字号:
function [symbols]=down_sampler(indata,sample_nr,fs,T,block_length)% [symbols]=down_sampler(indata,sample_nr,fs,T,block_length)%% Output:% symbols - Symbols after downsampling% % Input:% indata - Symbols after matched filter % sample_nr - The time to sample indata, given as a sample number% fs - Sampling frequency% T - Symbol period% block_length - Length of original indatablock = length of the % output variable symbols %% Short Theoretical Background for the Function:% % Downsamples indata. % sample_nr decides which sample to begin sampling on. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% Function part of simulation for Space-Time%%% coding project, group Grey-2001.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Author: Fredrik Hansson% Date: 2001-03-21% Version: 1.0% Revision (Name & Date):% 1.1 SU 2001-03-25 Added the if-expression to avoid sampling outside indata-vector% if syncroniztion-function "failed".%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%oversamp = fs*T;last_symbol = (sample_nr + (block_length-1)*(oversamp));if (last_symbol > length(indata)) % avoiding sampling outside indata when sample_nr is bad. sample_nr = length(indata) - (oversamp * block_length) last_symbol = (sample_nr + (block_length-1)*(oversamp)); endsymbols = indata(sample_nr:oversamp:last_symbol); % keep every oversamp磘h symbol beginning at sample_nr
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -