Dear developers,
I would like to plot the "greasy" test signal in Matlab, and then plot a Gauss function in the same plot. The script below does that.
But I would like to be able to place the Gauss function at a certain position, so I see that others often use CIRCSHIFT to move plots.
When I use it I can move the Gauss function to the left or right, but not up and down.
PGAUSS used in the script comes from the LTFAT DSP third party toolbox, but it could for debugging be any function. E.g. -x^2.
Can someone figure out, what I am doing wrong?
Here is how it looks with [0 0]
Here is how it looks with [0 111]
Here is how it looks with [111 0]
Lots of love, Louise
g = greasy;
fs = 16000;
Lg = length(g);
% -2441 so just get the first 500 points
L2 = floor(Lg/2)+1 - 2441;
gf = greasy;
gf = gf(1:L2);
hold on
plot (1:L2,gf);
xlabel('Time / samples');
ylabel('Amplitude');
% Contructing values to make the plot look as desired
L = 500;
tfr = 1;
cent = 300;
%gw = pgauss(L,tfr,cent)
% Here I would have expected the Gauss function to be
% moved down, but nothing happens.
gw = circshift(pgauss(L,tfr,cent), [0 -1]);
plot(gw,'Color','red');
% Multiply the signal with the Gauss window
figure(2);
plot(gf.*gw);