⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 corrnum.m

📁 很多matlab的源代码
💻 M
字号:
function Y =corrnum(x,y,dt)
% CORRNUM Correlation.
%
%	Z = CORRNUM(X,Y,TS) Computes the correlation of X and Y 
%       TS = sampling interval [Default: TS = 1].
%	Z returns Rxy where Rxy = conv(x,fliplr(y))
%       If X = Y, the result is the autocorrelation.
%
%       CORRNUM invokes the following example:
%
%	% Compute the correlation of X1=[1 2 3 4] and X2=[2 -1 4] if TS = 0.5s
%         >>X1 = [1 2 3 4]; X2=[2 -1 4];
%         >>Y1 = corrnum(X1,X2,0.5)


% ADSP Toolbox: Version 2.0 
% For use with "Analog and Digital Signal Processing", 2nd Ed.
% Published by PWS Publishing Co.
%
% Ashok Ambardar, EE Dept. MTU, Houghton, MI 49931, USA
% http://www.ee.mtu/faculty/akambard.html
% e-mail: akambard@mtu.edu
% Copyright (c) 1998


if nargin == 0,help corrnum,disp('Strike a key to see results of the example')
pause,X1 = [1 2 3 4],X2=[2 -1 4],Y1 = corrnum(X1,X1,0.5),return,end

Y = conv(x,fliplr(conj(y)));
Y = conj(Y);
if nargin == 3,Y = Y*dt;end

⌨️ 快捷键说明

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