Category ArchiveMatlab
Matlab & UNH ECE Andrew Kun on 05 Dec 2007
UNH ECE Neural Networks Course: Student Presentations
During the week of December 3, 2007 students in the ECE 774/874 course gave 10-minute presentations on a neural networks-related topic of their choice. This is the third time I’m teaching this course, but only the first time I’ve asked students to give presentations to wrap the course up. I have to say that I was pleased with the results.
Ten students presented their work over three class periods. First up on Monday was Dan Reynolds who talked about using perceptrons for character recognition (see picture below). He ran a Matlab script and discussed the results. Great work Dan!

Next, Charlie Brickham discussed neural nets for image processing. After Charlie, we heard Jon Oppelaar talk about the Elman neural architecture which allows the recognition of time sequences. Finally, the last presentation on Monday was given by Andras Fekete who discussed using neural nets to train the coefficients for a PID controller.
On Tuesday, the first presentation was by Jonathan Carrier who talked about a Matlab script that he created to explore the Kohonen self organizing map. This was a fun presentation with nice visualizations of the Kohonen SOM (see picture below) and a Matlab demo. Nice work Jon!

Next up was Matt Minuti, who implemented a growing SOM neural network to compress sound files. Matt played examples of sound files in wav and mp3 form as well as compressed with his neural network. The result of compression with his network was not perfect, but this was a fun project. Nice work Matt! Here is a picture of Matt during his presentation:

As the last presentation on Tuesday, Oszkar Palinko introduced a speaker verification system he created in his undergraduate days.
On Wednesday Ivan Elhart gave the first presentation and discussed a paper by Italian researchers who used neural networks to classify honey. Nemanja Memarovic discussed the Matlab neural network toolbox and he showed demos available with the toolbox. The last presentation was given by Mike Farrar who proposed a neural network design for steerable sound projection.
As I said, I was very pleased with all of the presentations. However, I did want to mention three students who I thought did exceptionally well: Dan Reynolds, Jon Carrier and Matt Minuti. Dan, Jon and Matt not only had well-designed presentations, they also showed us live demos that really helped get their points accross. Congratulations guys on a job well done.
I also wanted to thank Jonathan Carrier, Jonathan Oppelaar and Oskar Palinko for scheduling and moderating the presentations, and making sure we had a laptop to use. Thanks also to Dan Reynolds and Jon Carrier for taking pictures, more of which you can see here.
Andrew Kun
Driving simulator & Matlab & Project54 & User interface oszkar on 20 Nov 2007
Steering wheel sensor
Hello all,
For some time now, beside other things, I have been working with pressure sensors on the steering wheel. I mounted four of them to the perimeter of the wheel. They are connected to an amplifier board. The signal is then fed to a Texas Instruments eZ430-RF2500 board, which serves as an AD converter and a wireless transmitter. Very interesting thing if you are amazed by small electronic devices, like me. The following figure shows the setup:

The data is collected and recorded at a remote computer. I combined the data from the sensor with the data from the simulator, and visualized it in Matlab. It is shown in the following video. The wheel is displayed in yellow where no pressure is detected. It gradually turns to gray and black depending on the amount and location of pressure. First, the wheel is squeezed multiple times in a clock-wise manner without driving. Second, a city scenario is driven, while the hands are fixed at around 10 and 2 o’clock. It can be noticed that the brightness is changing depending on the amount of pressure on a certain segment.
Now, that the sensor system is completed, it can be used in a number of ways: to trigger a Push-To-Talk signal or to collect tapping patterns and map different taps to certain commands. For example two taps on the left-upper sensor could activate the left index light or lights and siren, etc. It has may possibilities. If you have a good idea, what else it can be used for, please let me know by leaving a comment. Thanks.
On another topic, I recently rediscovered Matlab’s possibility to record .avi videos. It can be a handy tool if you want to present results over time and with more than one space dimension. Just type ‘avifile’ in Matlab Help, the usage is self explanatory from the example.
Cheers,
Oszkar Palinko
Matlab & Software & User interface András Fekete on 31 Oct 2007
Matlab peculiarities
Hello readers!
So while working on my Neural Networks homework, I stumbled across an interesting problem when using the surf command in Matlab. Try running the following commands:
Xi = -2 + [0:20]*0.2;
Xj = -2 + [0:20]*0.2;
X = zeros(2,size(Xi,2)*size(Xj,2));
for i = 1:size(Xi,2)
n = (i-1) * size(Xj,2);
for j = 1:size(Xj,2)
X(:,n + j) = [Xi(i); Xj(j)];
end
end
Y = -1 + double((X(1,:).^2 + X(2,:).^2)
surf(Xi,Xj,reshape(Y,size(Xi,2),size(Xj,2)))
Running this on two different machines produces different graphs:
vs
The first image is the correct output. Note how in the second image, the top-right corner of the cylinder is chopped off. Check your Matlab and see what it outputs. Both of these images were done using Matlab 2007a. If you have a version that doesn’t output the correct graphs, a remedy to the problem is to go to “Edit”->”Copy Figure”, it will either rerender the image on the screen, or at worst put the correct image into the copy buffer.
Fekete András
Matlab & Tips and tools Andrew Kun on 15 Oct 2007
Matlab “not equal” function - be careful how you use it!
When using the Matlab “not equal” function (~= or ne) with vectors and matrices, one has to be careful. I found this out the hard way, playing with some m-code for a homework in my Introduction to Neural Networks course. The issue is that the ~= function evaluates matching pairs of vector/matrix elements one at a time and produces a vector/matrix output. For example, you can do this in the Matlab command window:
>> a = [1 1];
>> b = [1 2];
>> a~=b
ans =
0 1
What’s to be careful about? Well, I wanted to use ~= in an if statement. To do this, type the following in the Matlab command window:
>> if max(a~=b) > 0; c = 1; else c = 0; end
>> c
c =
1
What if you just evaluate a~=b? For the example above:
>> if a~=b; c = 1; else c = 0; end
>> c
c =
0
Not what you expected, right? It took me a while to catch this. Of course, I could have read Bruce Driver’s Matlab primer (scroll down to the end of Section 6). From his page I also learned that the following will work (note that each corresponding element of a and b is different):
>> a = [1 1];
>> b = [2 2];
>> if a~=b; c = 1; else c = 0; end
>> c
c =
1
Bruce also suggests using the “any” Matlab function in the above evaluation as well as just simplifying the whole thing by looking for vectors/matrices that are equal:
>> a = [1 1];
>> b = [1 2];
>> if a==b; c = 0; else c = 1; end
>> c
c =
1
So, be careful, the Matlab ~= function returns a vector/matrix when you compare vectors/matrices.
Andrew Kun
