118 4. LINEAR TIME-INVARIANT SYSTEMS AND CONVOLUTION
Java_com_dsp_matlab_Filters_compute(JNIEnv
*env, jobject thiz,
jfloatArray input, jint Fs, jint choice,
jint frameSize)
is allows one to pass values from Java to the MATLAB C code.
4. Add the new variable as a parameter to the LR4_4 function call.
LR4_4(_in, x_size, Fs, choice, y);
e variable y will now hold the output of the choice selected. Update the initialize and ter-
minate functions to reflect the new lab number. In the file Filter.java, pass the new choice to the
compute function as follows:
currentFrame.setFiltered(Filters.compute(currentFrame.getFloats(),
Settings.Fs, Settings.choice, Settings.blockSize));
5. And, lastly, the file Filters.java updates the interface to MatlabNative.c. Update it by adding
the new parameter,
public static native float[] compute(float[] in,
int Fs, int choice,
int framesize);
ese are the typical files that will change from lab to lab. Compile the code and select different
outputs.
4.7.2 iOS STEPS
e iOS steps in order to add the plot selection are covered here. Instead of copying the LR4_3
Xcode project, it is better to create a new project. e project initialization was covered previ-
ously. After the initialization is done, copy the Main.storyboard, ViewController, and Audio-
Controller files from the previous project to the current. is can be done in either Xcode or
in the Finder app. is allows modifying the LR4_3 code to the LR4_4 requirements. Again,
update all the references of LR4_3 to LR4_4. Add the “Native Code” group and add the .c and
.h files from MATLAB. Also, add the “Audio Files” group with the included set of .caf files.
One can continue to add new picker view option.
1. Add the pickerView from the storyboard view. Some item may have to be re-arranged to
fit the new item.