Scilab Function
Last update : 1/11/2005
pwmratio - Pulswidth
demodulation
Calling Sequence
-
[Qratio,pr,km,qpr] =
pwmratio(Q)
Parameters
-
Q
: row vector, contains binary input sequence with {0,1}
elements
-
Qratio
: PWM result, same size as Q. On the falling edges of Q the PWM
result is updated
-
pr
: extracted PWM result. The length of pr is equal to the number
of falling edges of Q.
-
km
: extracted period time. The length of km is equal to the
falling edges of Q
-
qpr
: vector with same size as Q. On the falling edge positions of
Q, qpr contains the PWM result.
Description
-
This function can be used to evaluate the ratio between HIGH and
LOW phases of a binary input sequence. The input sequence is specified
by a row vector containg elements 0 or 1.
Examples
x=rand(1,200,'normal');
[B,A]=butter(8,0.05);
y=mtlb_filter(B,A,x);
yb=bool2s(y>0); // Generate random binary sequence
[Qout,pr,km,qpr]=pwmratio(yb);
k0=0:1:199;
plot2d(k0,yb,style=3);
plot2d(k0,Qout,style=2);
plot2d(k0,qpr,style=7);
disp(pr);
disp(km);
// end of example "pwmratio"
See Also
findgrup
,
Authors
-
Dr. Andreas Geissler geisslea@web.de
Used Function
findgrup