Skip to content
Snippets Groups Projects
Commit 2ab595e1 authored by Marina Kreme's avatar Marina Kreme
Browse files

unnecessary file deletion

parent 26a6f50c
No related branches found
No related tags found
No related merge requests found
function x = compute_ambiguity_function(x, dgt ,apply_fftshift)
%% x = compute_ambiguity_function(x, dgt ,fftshift_)
% is used to compute the ambiguity function.
%
% Inputs:
% - x : vector
% - dgt : Gabor transform operator
% -apply_fftshift: Boolean
%
%Author: Marina KREME
%%
switch apply_fftshift
case 'True'
x = dgt(fftshift(x));
case 'False'
x = dgt(x);
otherwise
fprintf('Incorrect value fftshift_\n')
end
\ No newline at end of file
function [gabmul_op, varargout] = gen_gabmul_operator(dgt, idgt, mask)
%% GEN_GABMUL_OPERATOR computes a Gabor multiplier
% [gabmul_op, varargout] = gen_gabmul_operator(dgt, idgt, mask)
%
% Inputs:
% - dgt: Gabor transform operator
% - idgt: inverse Gabor transform operator
% - mask: binary known mask
% Output:
% - gabmul_op: gabor multiplier- handle function
%
% Author : A. Marina KREME
% e-mail : ama-marina.kreme@lis-lab.fr/ama-marina.kreme@univ-amu.fr
% Created: 2020-28-01
%%
gabmul_op = @(x)idgt(mask.*dgt(x));
varargout{1} = mask;
end
\ No newline at end of file
function mask = generate_rectangular_mask(nbins, hop, sig_len, t_lim, f_lim)
%% GENERATE_RECTANGULAR_MASK
% This function generates a rectangular mask
% mask = generate_rectangular_mask(nbins, hop, sig_len, t_lim, f_lim)
% Inputs:
% - nbins: numbers of channels (int)
% - hop : length of time shift (int)
% - sig_len: signal length (int)
% - t_lim : time value interval
% - f_lim : frequency value interval
%
% Outputs:
% - mask : mask
% Author : A. Marina KREME
%%
M = nbins/2 +1;
N = sig_len/hop;
if size(f_lim,2)~=2 || size(t_lim,2)~=2
error("Incorrect value. f_lim or t_lim must be an interval")
end
mask = zeros(M,N);
f_lim = round(f_lim*size(mask,1));
t_lim =round(t_lim*size(mask,2));
mask(f_lim(1):f_lim(2),t_lim(1):t_lim(2))=1;
end
function plot_ambiguity_function(x, dgt , dgt_params, signal_params, dynrange)
%% plot_ambiguity_function(x, dgt , dgt_params, signal_params, dynrange)
% This function compute and plot ambiguity function for a given vector
%
% Inputs:
% - x: signal
% -dgt: Gabor transform operator
% - dgt_params: Signals parameters(sig_len, fs)
% - signal_params: Discrete Gabor Transform parameters(hop, nbins,win, ect..)
% - dynrange : dynamic range (optional)
%
% Author: Marina KREME
%%
if nargin==4
dynrange = 100;
end
apply_fftshift ='True';
x = compute_ambiguity_function(x, dgt ,apply_fftshift);
plotdgtreal(x, dgt_params.hop, dgt_params.nbins, signal_params.fs,'dynrange', dynrange)
end
function mul1mul2= product_of2_multipliers(dgt, idgt, mask1, mask2)
% mul1mul2= product_of2_multipliers(direct_stft, adjoint_stft, mask1, mask2)
%
% This function generates the product of two multipliers
% associated with two masks.
%
% Inputs:
% - dgt: short-time Fourier transfrom operator
% - idgt: inverse short-time Fourier transfrom operator
% - mask1, mask2: binary known mask
% Output:
% - mul1mul2, mul2mul1: product of two gabor multipliers- handle function
%
mul1mul2 = @(x)idgt(mask1.*dgt(idgt(mask2.*dgt(x))));
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment