USAGE : w=fresolve(x,K,[w_GT]); FUNCTION : Super-resolves the largest K peaks of the DFT of the signal x using the formula published in a "Tips & Tricks" column of the IEEE Signal Processing Magazine (2023). If the ground-truth frequencies, w_GT, are given as input, comparisons with the super-resolved frequencies are shown as well, together with some visualization. If the DFT has less than K peaks, a warning occurs. INPUT : * x, the samples of the signal * K, the number of peaks to resolve * w_GT, the ground-truth frequencies (optional), only needed for comparison with the super-resolved frequencies and plots OUPUT : * w, the (cyclic) frequency after super-resolution (in ]-pi,pi]) DATE : October 2023 AUTHOR : Thierry Blu, mailto:thierry.blu@m4x.org REFERENCE: Guo, R. & Blu, T.,"Super-Resolving a Frequency Band", IEEE Signal Processing Magazine, 2023. To appear. __________________________________________________________________________ EXAMPLE OF USE % Generation of N samples of a signal made of K frequencies K=5;N=30; % First, choosing frequencies (reasonably separated from each other) sep=5; w_GT=sort(2*pi*rand(sep*K,1)); w_GT=pi-w_GT(1:sep:end); % Second, choosing amplitudes (with reasonably close absolute values) a_GT=randn(K,2)*[1;1i]; a_GT=a_GT./abs(a_GT).*(1+0.1*rand(K,1)); % Third, building the samples of the signal x=a_GT.'*exp(1i*w_GT*(0:(N-1))); % Finally, super-resolving the K DFT peaks w=fresolve(x,K,w_GT);