Analyzing RC response with convolution theorem and fft.

Click For Summary
SUMMARY

The discussion centers on the validity of using the MATLAB code y=ifft(fft(x).*fft(h)) for analyzing the response of a system via the convolution theorem and the discrete Fourier transform (DFT). Participants clarify that while this approach yields results compatible with analytical outcomes, it is essential to understand that it represents circular convolution, which requires zero-padding of input vectors to avoid truncation errors. The conversation also touches on the implications of using Dirac delta functions in impulse modeling and the necessity of incorporating the time step dt for certain signals like cos(t) to align results with analytical expectations.

PREREQUISITES
  • Understanding of Discrete Fourier Transform (DFT)
  • Familiarity with MATLAB programming, specifically the fft and ifft functions
  • Knowledge of convolution theory and its application in signal processing
  • Concept of zero-padding in the context of DFT
NEXT STEPS
  • Research the implications of circular convolution in DFT and its practical applications
  • Explore MATLAB's fft and ifft functions in detail, including their parameters and options
  • Study the effects of zero-padding on DFT results and how it mitigates truncation errors
  • Investigate the role of time steps dt in signal analysis and its impact on convolution results
USEFUL FOR

Signal processing engineers, MATLAB users, and researchers analyzing system responses through convolution and Fourier analysis will find this discussion beneficial.

davidbenari
Messages
466
Reaction score
18
Some textbooks like (Numerical recipes the art of scientific computing) derive the DFT as a Riemann sum of the CTFT. With this in mind it would be natural then to approximate the identity

##y(t)=x*h=\mathcal{F}^{-1}\big\{XH\big\}##

with the mathlab code y=ifft(fft(x).*fft(h)) which roughly means that my response is the inverse DFT of the product of the DFTs.

I have been reading recently that this approach isn't really valid in the case of the DFT. The relevant identity in the discrete realm is

##\mathcal{F}^{-1}(XH)_{n}=\sum_{l=0}^{N-1} x_l (y_N)_{n-l}##

which is called a circular convolution.

But so far, my ifft(fft...) approach yields results that are completely compatible with the analytical results.

I also want to mention that I have checked for the well-known result that convolving with a shifted impulse, shifts your response along the domain; and the result that scaling an impulse, scales the response.

I've implemented impulses by inputting the coefficient in the dirac-delta function in some position on a vector, without really justifying why this works.

So therefore I have two questions:

Why is the y=ifft(fft(x).*fft(h)) approach valid and compatible with the theory? Is this the way its supposed to be? How can I justify such a thing? Why aren't the step factors ##dt## involved in this approach?

Why are impulses correctly modeled by only inputting the coefficient that would correspond to the dirac-delta function? (This seems intuitive to me, but I wouldn't like to say my opinion as I would prefer to listen to you mostly).

Finally, if I want to analyze another signal like cos(t), I do have to include the step ##dt## in order to get results congruous with the analytical results. Why is this occurring ?

Thanks!
 
Engineering news on Phys.org
Circular convolution using DFT will give you approximately the same results as regular convolution as long as you zero-pad your input vectors, typically you make them twice as long as the input data,.

This is for the usual reason: the original identity requires you to integrate +-inf; in a DFT you obviously have to use a finite sized vector and this truncation is what is causing problems. A DFT is never just a "numerical Fourier transform", there are a whole bunch of issues that you need to keep track of to avoid errors (see windowing, padding etc)
 
Last edited:
  • Like
Likes   Reactions: davidbenari

Similar threads

  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 2 ·
Replies
2
Views
7K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 6 ·
Replies
6
Views
6K
  • · Replies 1 ·
Replies
1
Views
2K