mixer.m

来自「Matlab communication toolbox.」· M 代码 · 共 47 行

M
47
字号
function [out] = mixer(in,fc)

% MIXER ....... Mix (multiply) two input sequences.
%
%	Z = MIXER(X,Y) generates the sequence Z such that: Z(n) = X(n)*Y(n).
%

%	AUTHORS : M. Zeytinoglu & N. W. Ma
%             Department of Electrical & Computer Engineering
%             Ryerson Polytechnic University
%             Toronto, Ontario, CANADA
%
%	DATE    : August 1991.
%	VERSION : 1.0

%===========================================================================
% Modifications history:
% ----------------------
%	o   Added "checking"  11.30.1992 MZ
%	o	Tested (and modified) under MATLAB 4.0/4.1 08.16.1993 MZ
%===========================================================================

global START_OK;
global SAMPLING_CONSTANT;
global SAMPLING_FREQ;
global BINARY_DATA_RATE;
global BELL;
global WARNING;

check;

n = length(in);
dim = length(fc);
if(n > dim )
   eval(BELL)
   fprintf('WARNING\n');
   fprintf('The input waveform is truncated to the miximum allowable\n');
   fprintf('binary data size %5.0f\n', (50000/SAMPLING_CONSTANT));
   carrier = fc;
   x = in(1:dim);
else
   carrier = fc(1:n);
   x = in;
end
x = x(:)';
out = carrier.*x;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?