[ea1ce1]: gabor / plotdwilt.m  Maximize  Restore  History

Download this file

57 lines (46 with data), 1.6 kB

 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
44
45
46
47
48
49
50
51
52
53
54
55
function plotdwilt(coef,varargin)
%PLOTDWILT Plot DWILT coefficients
% Usage: plotdwilt(coef,);
% plotdwilt(coef,fs);
% plotdwilt(coef,fs,dynrange);
%
% `plotdwilt(coef)` will plot coefficients from |dwilt|.
%
% `plotdwilt(coef,fs)` will do the same assuming a sampling rate of *fs*
% Hz of the original signal. Since a Wilson representation does not
% contain coefficients for all positions on a rectangular TF-grid, there
% will be visible 'holes' among the lowest (DC) and highest (Nyquist rate)
% coefficients. See the help on |wil2rect|.
%
% `plotdwilt(coef,fs,dynrange)` will additionally limit the dynamic
% range.
%
% `plotdwilt` supports all the optional parameters of |tfplot|. Please
% see the help of |tfplot| for an exhaustive list.
%
% See also: dwilt, tfplot, sgram, wil2rect
% AUTHOR : Peter L. Søndergaard.
% TESTING: NA
% REFERENCE: NA
if nargin<1
error('%s: Too few input parameters.',upper(mfilename));
end;
definput.import={'ltfattranslate','tfplot'};
[flags,kv,fs]=ltfatarghelper({'fs','dynrange'},definput,varargin);
M=size(coef,1)/2;
% Find smallest value in the coefficients, because we will be inserting
% zeros, which messes up the dynamic range. Set a minimum value of the
% dynamic range based on this
maxc=max(abs(coef(:)));
minc=min(abs(coef(:)));
if isempty(kv.dynrange)
if flags.do_db
kv.dynrange=20*log10(maxc/minc);
end;
if flags.do_dbsq
kv.dynrange=10*log10(maxc/minc);
end;
end;
coef=wil2rect(coef);
yr=[0,1];
tfplot(coef,M,yr,'argimport',flags,kv);

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks