How to run the FILTER DESIGN GUI:
Download MATLAB GUI and the required functions
How to set path to the specific folder in MATLAB
Run the file called lowpass_filter.m
Download MATLAB GUI and the required functions:
Download the zip file in to your computer:
Once the file is saved, go to the folder wherever the file is saved, and right click on the file and click on “extract," "expand," or something similar. A new folder could be created so that the zipped files could be extracted into that specific folder. Some computers might not have this option “extract here”. Windows file compression software which is built in with windows XP, could be used in that case. Extract it somewhere which would be easy to remember and easy to find later on.
Check all the m files and folders after the zipped file is extracted:
Once the zip file is extracted, a total of four folders should be found. These are the folders that should be present:
i. Equal Ripple
ii. Maximally flat
iii. Graphing
iv. General
If any of these folders are missing, then the zipped files were not extracted properly and the previous step should be repeated. Here is the list of M-files that should be in the listed file folders: (Excel file)
Open MATLAB and set the path (see the next section on how to do this) to these following folders:
i. Each of the 4 folders/directories.
ii. The main directory wherever those 4 folders are saved.
How to set path to a directory in MATLAB:
§ Open MATLAB and the command window should open. Stay on the Home tab.
§ Click on Set Path….
Figure 1 - Setting up the path to the folders
A new window should pop up where options to add folders and subfolders are shown.
Figure 2 - Adding folders and sub-folders.
After setting up the path to all the desired folders and sub folders, click save and then close.
Run the file called lowpass_filter.m.
After you set up the current directory properly, go to the command window and type 'lowpass_filter'. It should open up the GUI.
Alternate way:
On the Home tab: click Open on the main window. A new window will pop up where you can browse through the files. Go to the directory wherever the file "lowpass_filter.m" is saved (which should be the in the General subfolder).
Choose the file and click on open.
It will open up in a new window. in the Editor tab click Run to open up the GUI.
You can find a general description of GUI here: General Info about MATLAB FIlter design GUI
Error Occurs:
If an error occurs in MATLAB that states, "Undefined function or method 'NameOfFunction' for input arguments...," then more than likely the GUI is trying to call a program written for it but can't access.
Look through all of the subdirectories that were downloaded until find the NameofFunction.m file that the GUI was trying to call.
Next, double click on it and hit the Run button.
A window will pop, as see in the figure below, asking you to either change, "...the current directory or add its current directory to the MATLAB path." Click the Add to Path button.
Close out the GUI figure. Then try running the "lowpass_filter.m" program again.
Figure 3 - MATLAB Editor Query.
When GUI calculates parameters for low pass filter design, it creates data files using different formats for COMSOL, SONNET, and GRAPHING GUI to use. You can select or type the name of the file (with extension .dat) that you want to save frequency and power loss data points for to use again in GRAPHING GUI.
The GUI will keep asking you to type valid file name with right extension until you type a valid file name with (.dat) extension to save the require data points.
It is important to note that the next time the GUI calculates parameters; it will replace the old data points with new ones if same file name is chosen. The data for COMSOL will also be saved in the specified file for saving MATLAB data with an addition of the word "COMSOL" to the filename.
The geometry file (.geo) for Sonnet will also be saved in the specified file for saving MATLAB data with an addition of the word "sonnet" to the filename and with an extension of .geo. For example, if you choose "data.dat" for MATLAB data, the COMSOL data will be saved in a file named "data_COMSOL.dat" and the geometry file for sonnet will be created as "data_sonnet.geo.
If you go to the folder where you saved your data files, there should be three different files: two data files (.dat) and one geometry file (.geo) for sonnet to read.