finding a changing dominant tone in a signal
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Kevin Claytor
le 24 Fév 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 commentaires
Voir également
Catégories
En savoir plus sur Time-Frequency Analysis dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!