-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsynsq_cwt_iw.m
43 lines (40 loc) · 1.45 KB
/
synsq_cwt_iw.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
% function x = synsq_cwt_iw(Tx, fs, opt)
%
% Inverse Synchrosqueezing transform of Tx with associated
% frequencies in fs. This implements Eq. 5 of [1].
%
% 1. E. Brevdo, N.S. Fučkar, G. Thakur, and H-T. Wu, "The
% Synchrosqueezing algorithm: a robust analysis tool for signals
% with time-varying spectrum," 2011.
%
% Input:
% Tx, fs: See help synsq_cwt_fw
% opt: options structure (see help synsq_cwt_fw)
% opt.type: type of wavelet used in synsq_cwt_fw
%
% other wavelet options (opt.mu, opt.s) should also match
% those used in synsq_cwt_fw
%
% Output:
% x: reconstructed signal
%
% Example:
% [Tx,fs] = synsq_cwt_fw(t, x, 32); % Synchrosqueezing
% Txf = synsq_filter_pass(Tx, fs, -Inf, 1); % Pass band filter
% xf = synsq_cwt_iw(Txf, fs); % Filtered signal reconstruction
%
%---------------------------------------------------------------------------------
% Synchrosqueezing Toolbox
% Authors: Eugene Brevdo (http://www.math.princeton.edu/~ebrevdo/)
%---------------------------------------------------------------------------------
function x = synsq_cwt_iw(Tx, fs, opt)
if nargin<3, opt = struct(); end
if ~isfield(opt, 'type'), opt.type = 'morlet'; end
% Find the admissibility coefficient Cpsi
Css = synsq_adm(opt.type, opt);
[na, N] = size(Tx);
% Integration
% Due to linear discretization of integral in log(fs), this becomes
% a simple normalized sum.
x = real(1/Css * ones(1,na) * Tx);
end