Interpolation algorithm for discrete time series (using FFT)

Source: Internet
Author: User

Sometimes, in order to be more convenient for subsequent processing, we need to interpolate the collected data points, that is, the so-called oversampling. In this paper, we discuss some common interpolation algorithms.

UseFFTachieve signal interpolation

Our signal x (t) is a real signal with limited bandwidth and limited energy. X[n] =x (nΔ) and x ' [n] =x (nδ ') are two samples of this signal and both satisfy the requirements of the sampling theorem, meaning that the information is not lost. The sample rate of two samples satisfies the following relationship.


This means that the sampling rate of the second sample is M times the sample rate of the first sample . If we have x ' [n], then it's easy to get x[n]:


But the reverse is not so easy. Here's how to calculate X ' [n] in the case of known X[n].

The length of the set X[n] sequence is n, andthe length of the X ' [n] sequence is Mxn. Then the spectra of the two sequences are as follows:


At the same time, there are two inverse transformation formulas:

From the above deduction we first see that, that is, the frequency points calculated by these two sequences are the same. Both of these sequences satisfy the law of the quest sampling, so the values of the corresponding frequency points on the spectrum should be related. And this relationship can be deduced by the inverse transformation formula.

As can be seen, if, then x[n] = x' [NM]. But the x' [n] will have many elements that are complex values. We know that the Fourier transform of the real sequence satisfies the following conditions:. You can do this if you want to extend this condition.

When N is odd:


When N is an even number:


Here to pay special attention,N/2 that element needs to be divided into two parts, before and after each half, only then the result of the transformation is right. Similar processing is also encountered when using FFT to calculate discrete analytic signals.

Below is a code for SCILAB  Span style= "Font-family:times New Roman" >scilab MATLAB  Similar, array subscript from 1 Start, so the above formula needs to be modified a bit.

Function y = fft_interp (x, n)    s = size (x);    if s (1) = = 1 then         NX = S (2);        NY =  (NX) * N;        S (2) = NY;    else        NX = s (1);        NY =  (NX) * N;        S (1) = NY;    End        y = zeros (s (1), S (2));        xx = FFT (x);    if (NX/2) = = Int (NX/2) then/even        s = nx/2;        Y (1: (1+s)) = XX (1: (1+s))        y (ny-s+1:ny) = XX (nx-s+1:nx)         y (1+s) = y (1+s)/2        y (ny-s+1) = y (ny-s+1)/2    else        s = (nx-1)/2;        Y (1: (1+s)) = XX (1: (1+s))        y (ny-s+1:ny) = XX (s+2:nx)            end    y = Ifft (n*y) endfunction


The above code is indicative, without considering the problem of computational efficiency. Practical application, can be further optimized on this basis.

Interpolation algorithm for discrete time series (using FFT)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.