finding a changing dominant tone in a signal
조회 수: 4 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Kevin Claytor
2016년 2월 24일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Time-Frequency Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!