ni.com is currently undergoing scheduled maintenance.
Some services may be unavailable at this time. Please contact us for help or try again later.
11-27-2006 03:24 PM
11-28-2006 12:06 PM
11-28-2006 01:47 PM
% routine for calculating Transfer Function
% signal is the array containing the measured signal
% sigs is the array containing the input sine wave
% sigc is the array containing the input cosine wave
freq=11.45;
sfreq=52.4*freq;
cycs=10;
t=0:1/sfreq:cycs/freq;
n=cycs*52.4+1;
ph=60;
signal=0.2*sin(2*pi*freq*t+ph*pi/180);
sigs=sin(2*pi*freq*t);
sigc=cos(2*pi*freq*t);
real=signal.*sigs;
comp=signal.*sigc;
a=(2*sum(real)-real(1)-real(n))/(n-1);
b=(2*sum(comp)-comp(1)-comp(n))/(n-1);
R=sqrt(a*a+b*b)
ang=atan(b/a)*180/pi
11-29-2006 02:05 PM