finding a changing dominant tone in a signal
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
For my Thesis I am analysing aircraft noise, in here a fan tone is visible when creating a spectrogram, however after removing background noise by removing a large moving average form the original. When searching for peaks in a small time bin, 100ms, the remaining found peaks are still quite noisy.
A different approach was for every 100ms, get the corresponding samplepoints, use a bandpass filter so only the intersing part is left, where the fan tone is expected and fititng that to a sin and using the non lineair optimization toolbox in matlab to find the optimum. However, if I want to do this automatically, so using code, the fit is not as good as my starting points dont change. When doing it manually these points get chosen by matlab, and those are optimized starting points. Is there any way to change the mode in my code to make matlab determine optimal values? Instead of the hard coded number array I am using at the moment?
0 comentarios
Respuestas (1)
Kevin Claytor
el 24 de Feb. de 2016
Have you tried:
Raw data -> BP filter -> Spectrogram -> peak finding
You seem to have the parts for it, and I would expect it to be faster than nonlinear fitting.
But if you're dead-set on fitting instead, most of the fitting routines have the option for initial parameters. For example, when using fit from the CF toolbox, you can use fitOptions to specify your initial parameters, which can be drawn from the data programatically;
frequency = fan_freq;
f_low = 0.8*frequency;
f_high = 1.2*frequency;
amplitude = max(data) - min(data);
a_low = 0.8*amplitude;
a_high = 1.2*amplitude;
phase = ...
fo = fitoptions('Startpoint', [frequency, amplitude, phase],...
'Lower', [f_low, a_low, p_low],...
'Upper', [f_high, a_high, p_high]);
ft = fittype('a*sin(f*x +p)', 'independent', {'x'}, 'coefficients', {'f', 'a', 'p'}, 'options', fo)
fit(x, data, ft)
Just make sure to match the order of 'coefficients' to the order in 'startpoints', 'lower', and 'upper'.
2 comentarios
Ver también
Categorías
Más información sobre Time-Frequency Analysis en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!