help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

## Re: test this in matlab for my please

 From: Ozzy Lash Subject: Re: test this in matlab for my please Date: Fri, 15 Jul 2016 10:52:54 -0500

Doug,

I think that in the signal processing version of impinvar, the final argument it Fs not T,  I think if you change the call in your last example, you'll get better results:

>> [bz az]=impinvar(b,a,1/T)
bz =

0.0000e+00   4.8374e-04   4.6788e-04

az =

1.00000  -2.90484   2.80967  -0.90484

>> syssig=tf(bz,az,T)

Transfer function 'syssig' from input 'u1' to output ...

0.0004837 z + 0.0004679
y1:  ---------------------------------
z^3 - 2.905 z^2 + 2.81 z - 0.9048

Sampling time: 0.1 s
Discrete-time model.

I'm not sure if this is matlab compatible or not.

Bill

On Fri, Jul 15, 2016 at 10:18 AM, Ozzy Lash wrote:

On Fri, Jul 15, 2016 at 10:06 AM, Doug Stewart wrote:

On Fri, Jul 15, 2016 at 10:52 AM, Ozzy Lash wrote:

On Fri, Jul 15, 2016 at 5:50 AM, Doug Stewart wrote:

On Thu, Jul 14, 2016 at 2:56 PM, Ozzy Lash wrote:

Now Matlabe gives

ans =

0.1 z
-----          This is wrong!!!
z - 1

which has the zero at the origin but has a gain of 1/10th of what it should!
Matlab the does a correction factor of 1/T when they plot it so that it comes out correct,
but this does not help anyone who just wants the formula not the plot.

I think Matlab uses this convention for the impulse response because they are using the dirac delta function in the continous domain and the kronecker delta in the discrete time domain.  The dirac delta has area 1 under the curve, while the kronecker delta has an area of 1/fs under the curve (assuming a zero order hold, and defining the kronecker delta to have value 1 at index 0).

I think I have seen books teach this either the way Matlab is doing it, or by assuming a fs scale factor on the delta function that they use.  I think in either case, once you get past the early chapters, you just forget about any scale factor.

Bill

Thanks for the clarification.
I can live with the 1/Fs factor.
But I have one question.

when i do   [ 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0...] in octave, did
i make a kronecker delta or a dirac delta ?

The bigger problem is the fact that the numerator and denominator are wrong.

For the last example I did all the math by hand on paper, and found that Matlab
agreed with my work and not with impinvar().
Doug

--
DAS

that would be the kronecker delta.  (Actually I think I should have said unit impulse function, the kroneker delta is a function of 2 variables where it is 1 when they are equal and 0 otherwise, whereas the unit impulse is a function of 1 variable that is 1 at 0 and 0 elsewhere).  The dirac delta function is effectively infinite at 0 and 0 elsewhere, with the constraint that the integral is 1, so it is not really possible to represent it in octave/matlab/other discrete time environment.

If the difference is more than a scale factor, then I'm not sure what would be going on.

Bill

_

Thanks Bill
The Laplace transform if the Infinitely high infinitely narrow impulse function that has an area of 1 (dirac delta ) is 1 in Laplace space.
Now this also is represented at 1 in Z space.

What is the Z transform of the kroneker delta  function?

I just want to be clear about what the current terminology is.
I took that course 35 years ago  :-)

--
DAS

Yes, the z transform of the unit impulse is 1.  And if you are looking to me for "current terminology" you should look elsewhere.  I finished my undergrad in '84, (although I did get a masters in '95), but I haven't done a lot of that type of work in many years.  I do remember doing some project in matlab in the 90's and puzzled over why the discrete time stuff always seemed to be scaled, and happened to remember it when I saw your e-mail.

Bill

reply via email to

 [Prev in Thread] Current Thread [Next in Thread]