Hanning window, interpolation and resampling

13 views (last 30 days)
Sohel Rana
Sohel Rana on 15 Jan 2021
Answered: Asvin Kumar on 9 Feb 2021
Hi,
I have a mixed signal that contains three individual signals (see code below). Could you please tell me how could I do the following things?
  1. Convert the wavelength (lam1,lam2, lam) to wavenumber. I think it can be done by wavenumber=2*pi/wavelength.
  2. Then how to do interpolation of my signal (cubic spline) after coverting to wavenumber to make the data points evenly spaced?
  3. Then resampling to the interpolated data
  4. Then adding hanning window because it may help with data processing before FFT.
  5. Apply FFT
Signal in the above question is I.
I know all the functions are available in MATLAB but I could not utilize it properly.
m=1000; I1=0.5; I2=0.3; I3=0.2; L1=177*m; L2=170*m; n1=1; n2=1.446;
lam1=1500; lam2=1600; inc=(lam2-lam1)/(2^12-1);lam=lam1:inc:lam2;
Q12=(4*pi*n1*L1)./lam;
Q23=(4*pi*n2*L2)./lam;
Q13=Q12+Q23;
I_first=I1+I2+2*sqrt(I1*I2).*cos(Q12); % first signal
I_second=I2+I3+2*sqrt(I2*I3).*cos(Q23); % second signal
I_third=I1+I3+2*sqrt(I1*I3).*cos(Q13); % third signal
I=I_first+I_second+I_third; % mixed signal
plot(lam,I)

Answers (1)

Asvin Kumar
Asvin Kumar on 9 Feb 2021
This looks like it's part of an assignment. It would be better if you could share your attempts (code) so far and mention the errors you're running into.
Since you look like you're new to MATLAB, I'll provide links to a few examples:
  1. The linear waevnumber is inverse of the linear wavelength. Wiki
  2. Good page on cubic splines with multiple examples here
  3. This page lists three very good examples of resampling for different types of data.
  4. MATLAB has the hann function for hanning windows and this page should give you a basic idea of how to filter signals.
  5. Here's a link to examples of how to use the fft function.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!