Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Neural Networks to model the response of a loudspeaker HELP!!!! 2

Status
Not open for further replies.

MrFantastic1982

Computer
Aug 31, 2005
5
Hi there,
I am currently working on a problem using MATLAB and have come across some problems that I hope someone out there will be able to help solve.

Basically I am sending noise to a loudspeaker and recording that noise through a microphone. Then I want to train a NN in matlab ( I am using Radial Basis NN at the moment) so that the input values is the original noise file and the target values is what the microphone recorded.

I have recorded a test file and it is in sync with the original due to the software I used (aurora).

I have since then imported the two files into matlab and trained a RBF NN so that the original file X is the input and the recorded file Y is the target values.

This seems to have worked fine and when I simulate the NN with the x values the NN produces a file identical to the file Y.

However if I try to see what results I get by simulating the NN with different values all I get out of the NN is a matrix of zeros.

What I was hoping it to do was for me to be able to simulate the NN with an impulse (0,0,0,0,1,0,0,0,0) for example and where the NN has been trained using the values of the loudspeaker/microphone then the new output would be the impulse response of the pair.

I think this is the right way to go about it, but again all I get is a output matrix of zeros. PLEASE if ANYONE can offer any clues as to why I am getting zeros or if maybe I am going about this the wrong way, PLEASE could you let me know!!!

MANY MANY THANKS TO ANYONE IN ADVANCE

K
 
Replies continue below

Recommended for you

You explained your approach and the problem well. That is very good. I am assuming you are using a single layer and that your model is actually linear, but your parameter estimation process is non-linear and non-iterative. You should end up with a combination of basis functions and qweights that would ceate the impulse response. you may want to get the transfer function and impulse response and see if your NN created something close. Or did you coss vlidate already?

I do not know why you got all zeros, there must be something significanlty wrong for that. I do not think you should have gotten a yhat estimate out of your model that is identical to the measured data. That is wrong, maybe you overmodeled. You should have a cost function of some sort and a method of chossing how many basis functions you use.
If you can choose your basis fucntions to have a region of support of only one sample, then your NN learning should produce weights that are just the impulse response. That might be a good test of your model order selection and cost function and tell you if your input data set is spectrally rich enough. You might want to do an FFT of y and x and see if there are any nulls. If so, you will have problems. You might want to look at the "3 dB" points on your dominant y bandwidth. Take the recipocal of the frequency, then triple that, and you can get an idea of what tap length apeture you want to shoot for.
 

Hi thanks for your response I appreciate it!

I do have the impulse response of the microphone/loudspeaker pair already which I obtained from deconvolving the played sound source from the recorded one; I did this with a separate piece of software which uses linear techniques to do so.
I want to try and use nonlinear techniques to try and get something similar as I expect that a loudspeaker has a region of nonlinearity and would like to investigate this.

Back to the RBF NN, I am using MATLAB's toolbox function (newrbe) to help create my radial basis function neural network. net = newrbe (P, T, Spread) P and T being the played and recorded sources.

I know that I shouldn't be getting a result identical to my original output, but when I plot one negating the other I end up with a zero straight line, I would thought there would be some variation as the NN tried to order itself and learn the function.

I can't see any variable that would allow me to change the amount of basis functions that I use, however I am very new to this and may be overlooking it.
I know that the spread variable determines the width of an area in the input space to which each neuron responds, but I am not sure as to what figure to use and have been trying many "trials" to see its effect. MATLAB says that the bias is set to 0.8326/SPREAD?

I have tried several iterations with slightly changing values and I still basically get the same results, I know that there must be something wrong somewhere but I can't seem to put my finger on it.

Any thoughts?
Once again many many thanks.
K
 
I think your choice of NN will give you only a linear model, not a non linear model. You were looking forward to understanding something about the non linea nature of the loudspeaker. The newrbe may use a non linear search for it's linear model coeefiecients. I do not have that toolbox, but the notes for it say that you do get an exact model for your test vectors. That means that the model grows with the size of your test vectors. You might want to try a very small set of test vectors and test the model on a different subset of your test vectors and see how it does. You can also find the impulse response of you NN model. That would be very instructive.

When looking for a model for a speaker non lineaity you might want to look for ones that have memory non linearity instead of a memoryless nonlinearity.
 
Im getting the following warning when I am trying to train my NN:

Warning: Matrix is singular to working precision.
> In newrb>solvelin2 at 243
In newrb>designrb at 200
In newrb at 130
Warning: Rank deficient, rank = 5, tol = 2.4875e-012.
> In newrb>solvelin2 at 243
In newrb>designrb at 200
In newrb at 130

Any ideas as to what this means and how to solve it?

Many Thanks
K
 
I think htat means that your model is too complicated relative to your data. I think for the method you chose you will not have any control over it. You will have to change models to be able to have a much simpler (shorter) model and you will have to make your data richer.

Also, you said that you wanted a non linear model. But you are using a linear model. So you now have two reasons to change models.
 
yes i think that you are right.

I have tried creating 3 random matrices, p1, p2, p3, and filtering with a simple FIR Filter, with an impulse response known to me. This gave me f1, f2, f3 respectively.

Then I trained a NN with p1 and f1. Then when you simulate the NN with p1 you get something very close to f1.

However when you simulate with p2, and p3 (you would expect similar results i believe) however you get massively different values, some 10,000 different from what they should be.

My understanding was, that once you trained a neural network to the input and outputs of a black box, that neural network was basically a copy of the black box in this case the FIR Filter, so I would have thought that passing p2 and p3 through the NN I would get f2 and f3

K
 
by the way, p1 p2 and p3 were very simple 10 value matrices created with rand, so i dont understand why the NN are having trouble.

k
 
It may be that your 10 data points did not contain spectrally rich enough content to flush out the nuances of your FIR. Take a look at your FIR and find your dominant time constant (or bandwidth). For instance, if you designed a low pass filter with a 5 kHz cutoff and a 7 kHz stopband sampled at 100 kHz you would want enough data to have some content of orthogonal frequencies defined by the narrowest region. Since 7-5 is less than 5, this system is dominated by a 2 kHz BW. Take the reciprocal of 2 kHz and get a 0.5 ms time aperture. Double (or triple) this value to get a 1 ms aperture. At 100 kHz the 1 ms contains 100 samples. So in this case you would want at least 100 samples in each of your data sets. You would also want to do an FFT of your random data to make sure there is reasonable energy in the 5 to 7 region. Also, if your FIR has a lot of stopband loss you will have a very poor SNR to process on and any model fitting may try to match the stop band very tightly. In these cases, you would want a model fitting program that can ignore or at least weight some spectral content areas lower than others.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor