I have a measured pulse in time from a laser and I want plot the wavelength of the signal using an FFT. My measured signal looks like this.
I would like my FFT spectrum tolook like the below image (left).
Here is what I have tried:
Im = load('Autocorrellation1.mat');
G = wdenoise(sum(Im.Image),2);
G = G-min(G);
G = G/max(G);
dx = 1e6;
c=3e8;
dt = 2/(dx*c);
N = length(G);
Fs = 1/dt;
df = 1/(N*dt);
t = 0:dt:(dt*(N-1));
plot(t,G)
axis tight
xlabel('time (s)')
NFFT = 2^nextpow2(N);
bin_vals = [0 : NFFT-1];
N_2 = ceil(NFFT/2);
f = (bin_vals-N_2)*Fs/NFFT;
y = fft(G,NFFT);
wav = c./f;
S =abs(fftshift(y));
plot(f,S)