LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulating a Digital Filter using Z-Transform

Good evening!

 

I have some sampled data logged in text (.lvm) format which I would like to perform off-line digital filtering to.

 

I have a Z-transform of the form ( 1 + a * z^-1 )/( 1 + b * z^-1 ) to describe the behaviour for the given sampling rate.

 

I will use the "Read from Measurement File" to import to LabVIEW as dynamic data, I can then arrange that in an array if need be.  I am just unsure of how to implement the z-transform; are there any examples performing a similar function?

 

I apologise for the "can you help me?" type post but I have struggled to find information on building this.

 

Any help/references appreciated!

 

 

Peter 


Regards,

Peter D

0 Kudos
Message 1 of 9
(7,046 Views)

I'm assuming that you don't have the Control Design and Simulation Module.

 

You can calculate the difference equation, and implement it with shift registers.

Rodrigo Cuenca
www.cidesi.com

Message 2 of 9
(7,034 Views)

Thank you for the quick reply.

 

I do have access to that module and have located the H(z) "Discrete Transfer Function" element.

 

I have looked at some help files / examples and it would appear that all the simulation elements must lie within the Simulation Loop.  Can I pass an array into this loop to use as the input? 

 

I attach the VI I am using to obtain an array of my input data.

 

Regards,

 

 

Peter


Regards,

Peter D

0 Kudos
Message 3 of 9
(7,013 Views)

You don't need the simulation VIs, you need the Control VIs, try something like this.

Your file already gives you an array so you don't need the For loop.

Rodrigo Cuenca
www.cidesi.com

0 Kudos
Message 4 of 9
(7,004 Views)

Could you possibly take a screenshot and post?  Unfortunately I am running LabVIEW 8.5.

 

 

Peter


Regards,

Peter D

0 Kudos
Message 5 of 9
(6,980 Views)

By the way we are talking about the Z plan and not the S plane? Because if you have the "NI LabVIEW Digital Filter Design Toolkit" you can specify poles and Zeros in the Z plane and hence simulate your filter



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
Message 6 of 9
(6,975 Views)

I don't know the versions of your toolkits, but here is the vi in Labview 8.5, and also a screenshot

 

Digital Filter.jpg

Rodrigo Cuenca
www.cidesi.com

Message 7 of 9
(6,958 Views)

I used the "NI LabVIEW Digital Filter Design Toolkit" and the difference equation method to create my filter.  But I am getting some odd results when I apply my input data to the filter.

 

I have made some notes on the VI to what I am trying to do.

 

Basically trying to reduce the response time of a first-order system using filtering; the filter will cancel out the previous time constant and replace it with a new one.  I have pasted the bode plot of the system into my VI as there is no Flash on my computer to upload on here.

 

I am still trying to get my head around what is happening - the noise content of my real input signal could be having an adverse effect.

 

 

[ edit : attaching the VI ] 

 

Peter

Message Edited by PjayD on 04-14-2010 09:38 AM

Regards,

Peter D

0 Kudos
Message 8 of 9
(6,949 Views)

Ignore the above post - I realised the 'strange behaviour was the filter adjusting to the initial steady steady state.  Putting a longer steady state at the beginning of my sample data let the filter settle before trying to compensate for a change.

 

In real life the system would run continuously so the large error would only occur when the system first started up.

 

Now I just need to reduce the noise on my signal to allow for greater amplification; the more a try to speed the system up, the more the noise is amplified.

 

 

Peter


Regards,

Peter D

0 Kudos
Message 9 of 9
(6,937 Views)