Mercurial > hg > ddm
comparison ddm_example_1.m @ 4:72c011ed1977 tip
more elaborate example with non-stat. estimate explanation
author | smusevic |
---|---|
date | Tue, 30 Jul 2013 09:56:27 +0100 |
parents | e2b116f3b69b |
children |
comparison
equal
deleted
inserted
replaced
3:dde5034365b4 | 4:72c011ed1977 |
---|---|
32 %%% execute DDM on the whole frequency range (FFT) %%% | 32 %%% execute DDM on the whole frequency range (FFT) %%% |
33 % create linear systems | 33 % create linear systems |
34 [A, b, sig_fft] = ddm_lin_sys_fft(nr_bins, ddm_dgr, w', wd', poly_model', bffr, N, N_fft, fs); | 34 [A, b, sig_fft] = ddm_lin_sys_fft(nr_bins, ddm_dgr, w', wd', poly_model', bffr, N, N_fft, fs); |
35 % fast pseudo-inverse | 35 % fast pseudo-inverse |
36 ddm_estimates = flipud(pinv_2_fast(A,b,nr_bins,N-nr_bins+1).'); | 36 ddm_estimates = flipud(pinv_2_fast(A,b,nr_bins,N-nr_bins+1).'); |
37 | |
38 % phase function estimates | |
39 ddm_frequency_estimates_for_each_fft_bin = imag(ddm_estimates(2,:)); | |
40 ddm_linear_fm_estimates_for_each_fft_bin = imag(ddm_estimates(1,:)); | |
41 % amplitude funciton estimates | |
42 ddm_linear_am_estimates_for_each_fft_bin = real(ddm_estimates(2,:)); | |
43 ddm_2nd_dgr_am_estimates_for_each_fft_bin = real(ddm_estimates(1,:)); | |
44 | |
37 % re-assign the spectral magnitude | 45 % re-assign the spectral magnitude |
38 reallocate(abs(sig_fft), ddm_estimates, N_q, fs); | 46 ddm_spectrogram = reallocate(abs(sig_fft), ddm_estimates, N_q, fs); |
47 | |
48 % find the peak | |
49 [peak_val peak_bin] = max(ddm_spectrogram); | |
50 | |
51 % frequency trajectory of the peak bin | |
52 frequency_trajectory = ddm_linear_fm_estimates_for_each_fft_bin(peak_bin) * t + ddm_frequency_estimates_for_each_fft_bin(peak_bin); | |
53 | |
54 |