Skip to content

Commit

Permalink
added spreadfun as a local function to tconv - this introduces a code…
Browse files Browse the repository at this point in the history
… duplication, but the function is really short
  • Loading branch information
allthatsounds committed Oct 16, 2023
1 parent addd0e9 commit fbbcfac
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions gabor/tconv.m
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,27 @@
h=spreadfun(Th);

end;

function coef=spreadfun(T)
%SPREADFUN Spreading function of a matrix
% Usage: c=spreadfun(T);
%
% `spreadfun(T)` computes the spreading function of the operator *T*,
% represented as a matrix. The spreading function represent the operator *T*
% as a weighted sum of time-frequency shifts. See the help text for
% |spreadop| for the exact definition.
%
% See also: spreadop, tconv, spreadinv, spreadadj

complainif_argnonotinrange(nargin,1,1,mfilename);

if ndims(T)>2 || size(T,1)~=size(T,2)
error('Input symbol T must be a square matrix.');
end;

L=size(T,1);

% The 'full' appearing on the next line is to guard the mex file.
coef=comp_col2diag(full(T));

coef=fft(coef)/L;

0 comments on commit fbbcfac

Please sign in to comment.