Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 10 characters in body
Source Link
John
  • 143
  • 7

I just ran the example code, stepped into the tsa function, and saw the line 139:

enter image description here

By looking at the code in the red box, it seems that MATLAB assumes constant rpm in the same rotation and evenly divides the rotation time by number of points, is my guess right? Anyone agreesIs it a valid assumption?

Here is my code:

close all
clear all
clc

fs = 1000;
t = 0:1/fs:5-1/fs;

rpm0 = 2400;

a = 0.1;
f0 = rpm0/60;
T = 0.75;

phi = 2*pi*f0*T*(1-exp(-t/T));

x = a*cos(phi) + randn(size(phi))/200;
y = a*sin(phi) + randn(size(phi))/200;

plot(t,x,t,y)

[rpm,~,tp] = tachorpm(x(t<2.5),fs);
tachorpm(x(t<2.5),fs)

clf
tsa(x,fs,tp,'Method','linear')

I just ran the example code, stepped into the tsa function, and saw the line 139:

enter image description here

By looking at the code in the red box, it seems that MATLAB assumes constant rpm in the same rotation and evenly divides the rotation time by number of points, is my guess right? Anyone agrees?

Here is my code:

close all
clear all
clc

fs = 1000;
t = 0:1/fs:5-1/fs;

rpm0 = 2400;

a = 0.1;
f0 = rpm0/60;
T = 0.75;

phi = 2*pi*f0*T*(1-exp(-t/T));

x = a*cos(phi) + randn(size(phi))/200;
y = a*sin(phi) + randn(size(phi))/200;

plot(t,x,t,y)

[rpm,~,tp] = tachorpm(x(t<2.5),fs);
tachorpm(x(t<2.5),fs)

clf
tsa(x,fs,tp,'Method','linear')

I just ran the example code, stepped into the tsa function, and saw the line 139:

enter image description here

By looking at the code in the red box, it seems that MATLAB assumes constant rpm in the same rotation and evenly divides the rotation time by number of points, is my guess right? Is it a valid assumption?

Here is my code:

close all
clear all
clc

fs = 1000;
t = 0:1/fs:5-1/fs;

rpm0 = 2400;

a = 0.1;
f0 = rpm0/60;
T = 0.75;

phi = 2*pi*f0*T*(1-exp(-t/T));

x = a*cos(phi) + randn(size(phi))/200;
y = a*sin(phi) + randn(size(phi))/200;

plot(t,x,t,y)

[rpm,~,tp] = tachorpm(x(t<2.5),fs);
tachorpm(x(t<2.5),fs)

clf
tsa(x,fs,tp,'Method','linear')
Source Link
John
  • 143
  • 7

Does tsa function in matlab assume constant rpm in the same rotation?

I just ran the example code, stepped into the tsa function, and saw the line 139:

enter image description here

By looking at the code in the red box, it seems that MATLAB assumes constant rpm in the same rotation and evenly divides the rotation time by number of points, is my guess right? Anyone agrees?

Here is my code:

close all
clear all
clc

fs = 1000;
t = 0:1/fs:5-1/fs;

rpm0 = 2400;

a = 0.1;
f0 = rpm0/60;
T = 0.75;

phi = 2*pi*f0*T*(1-exp(-t/T));

x = a*cos(phi) + randn(size(phi))/200;
y = a*sin(phi) + randn(size(phi))/200;

plot(t,x,t,y)

[rpm,~,tp] = tachorpm(x(t<2.5),fs);
tachorpm(x(t<2.5),fs)

clf
tsa(x,fs,tp,'Method','linear')