PEZ - Import Options
[ Intro Functionality Add/Delete Edit Import Export ]
<< Previous Next >>

Import Options

PeZ has a number of methods of communicating with the Matlab environment. This communication allows users to better prod the filter data as well as save the data for later use.

To get to the Import Options, select the Import Filter Data button from the main window:

 
Selecting the Import Filter Data will set up a number of import options for the user to choose from. The default import option is to Import from Simple Data Values. There are currently four methods of importing: Data Values, File, [B,A]=, and Grab Filtdemo.
 
There is also a Matlab command line function for importing into pez.
 


 Importing Simple Data Values

The simplest way to add values is to give the filter array coefficients. The Import Values options appear as:
 
 
              Note: These values may be regular Matlab expressions to an extent, for example, select roots and enter:
                Pole Values:   cos(linspace(-pi,pi,5))+j*sin(linspace(-pi,pi,5))             Example:  5*x(n) + 3*x(n-1) + 1*x(n-2) ==> [5 3 1]             Example: x(n) - 3x(n-1) + 2x(n-2) = (x(z)-1)(x(z)-2) ==> [1 2]
 
 


Importing from File

The import from file option allows the user to load a Matlab file containing filter coefficients. Selecting this option sets the display to the following:
  Note: Matlab 4.2 and Matlab 5.x data files are not the same! I believe you can load the 4.2 files with 5.0, but not vice versa.

Import [B,A]=

Since there are a number of filter commands in Matlab that return filter coefficients in the form of [B,A], PeZ can import the results right into the system. What PeZ does is make the call exactly as the user types it, and tries to import the result straight into PeZ. The display appears as:
 

Example of what to place in the entry box:

[B,A] = butter( 5, 0.5, 'high' )

This will import a 5th order highpass Butterworth filter with cutoff at pi/2.


Grab Filtdemo

Probably one of the most interesting things about PeZ is that it can interact with other Matlab programs. There is a tool called 'filtdemo' that allows users to graphically create different types of filters based on response. Choosing the Grab Filtdemo in the import options of PeZ allows PeZ to examine Filtdemo and grab its current filter. This can all be done by:
  Currently there is no easy way to send the filter back to filtdemo, but then again, there's not much point.

 


Command Line Import

PeZ also allows users to import filter data through a Matlab command line program. The function is called pzimport and has the following format:
 
 
pzimport(B,A,GAIN,are_roots) 
B 
A 
GAIN 
are_roots
Zeros Coefficient Vector 
Poles Coefficient Vector 
This Filter's Gain 
0=B,A are Polynomials(Default) 
1=B,A are Roots
 
 
Examples:
 
>> pzimport(B,A) 
>> pzimport(B) 
>> pzimport(B,A,5) 
>> pzimport(B_root,A_root,8,1) 
Imports polynomials, gain of B(1) 
Imports polynomial Zero vector, gain of B(1) 
Imports polynomials with gain of 5(Ignores B(1)) 
Imports root vectors, gain of 8
 


[ Intro Functionality Add/Delete Edit Import Export ]
<< Previous Next >>