Clear Filters
Clear Filters

Implementation of Frequency Reassignment

8 views (last 30 days)
yair amar
yair amar on 6 Oct 2020
Answered: Addy on 31 Mar 2021
Hello everyone!
(page 14): when and is the STFT of the signal x, and the d stands for a derivative of the window h.
Our implementation follows the above mentioned calculations and yet does not work.
Any ideas as to what we miss here/ can be doen better?
% Init function handles
hann_func = @(n,N) 0.5*(1 - cos(2*pi*n/(N-1)));
hann_d_func = @(n,N,fs) (pi*fs/(N-1))*sin(2*pi*n/(N-1));
% intializing parameters
fs = 44100; N = 8192; f1 = 150; f2 = 420;
t_orig = 0:(1/fs):2.5;
x = cos(2*pi*f1*t_orig);
% creating windows
win = hann_func(1:N,N);
win_d = hann_d_func(1:N, N, fs);
% Applying STFTs with OL 50%
[X, f, t] = stft(x,fs,'Window',win,'OverlapLength',N/2,'fftLength',N);
[Xd, ~, ~] = stft(x,fs,'Window',win_d,'OverlapLength',N/2,'fftLength',N);
X_conj_over_norm = conj(X)./ (sum(abs(X)).^2);
Xdphase_dt = -imag(Xd .* X_conj_over_norm);
reass_f_X = f + Xdphase_dt/(2*pi);

Answers (1)

Addy
Addy on 31 Mar 2021
I'm don't know much about the mathematics. But I saw that they referred to tfrrsp function which can be found in the reference [3]. The [3] is the TF toolbox found in http://tftb.nongnu.org. So, I tried to compare apples to apples with tfrrsp vs MATLAB's STFT.
I have attached the necessary mfiles from that toolbox to produce reassigned stft.
The results are as follows:
//Addy

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!