down_sampler.m
来自「一个教你如何用matlab写mimo系统的程序」· M 代码 · 共 42 行
M
42 行
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 + =
减小字号Ctrl + -
显示快捷键?