Plotting the Fourier Transform in Python (DFT/FFT)

Поділитися
Вставка
  • Опубліковано 17 січ 2025

КОМЕНТАРІ • 18

  • @acelaox6836
    @acelaox6836 Рік тому +4

    Thank you so much now I didn't know about fftshift in numpy till today!

  • @markushinterthan7960
    @markushinterthan7960 2 місяці тому +1

    7:07 - it should be xt[-5:] to make it symmetric, since that would cover -5, -4, -3, -2, -1 complementary to 0, 1, 2, 3, 4.
    Thx for the covering the fftshift.

    • @SignalProcessingWithPaul
      @SignalProcessingWithPaul  2 місяці тому +2

      Keep in mind that even symmetry is defined as x[n] = x[-n] and odd symmetry is defined as x[-n] = -x[-n]. As a result, x[0] is a special value; it serves as the "anchor" of the symmetry if you will, but isn't included in the calculation. x[1] corresponds to x[-1], x[2] corresponds to x[-2], etc.
      I originally made this mistake and set x[-5:] = -1 when I was preparing for this video, and was wondering why the imaginary parts of the spectrum had nonzero values. I'd encourage you to try it out to see.

    • @markushinterthan7960
      @markushinterthan7960 2 місяці тому

      @@SignalProcessingWithPaul yes you are right

  • @starx8771
    @starx8771 7 місяців тому +1

    This was so helpful, thank you so much!

  • @idreeskhan-zp5ey
    @idreeskhan-zp5ey 10 місяців тому +2

    Thnak You!

  • @anonymousguy438
    @anonymousguy438 Рік тому +1

    How to know what are the different frequencies which constructs your main signal? I am asking about the frequency values not its amplitude.

    • @SignalProcessingWithPaul
      @SignalProcessingWithPaul  11 місяців тому +1

      I may make a video on this. To answer your question, it will be divisions of the sampling frequency of your signal (which is 1/T, where T is the time interval between samples). Given a sampling frequency Fs and N samples in the time domain, each index of the FFT will be at k*Fs/N. However at Fs/2, (meaning for all indices larger than N/2), the frequency "wraps around" and becomes negative due to aliasing. So I believe the frequency can be written concisely as (k*Fs/N) - ((N - k)*Fs / N * I(k > N/2)), where I is the indicator function.

  • @angeloc700
    @angeloc700 Рік тому +2

    Nice video. As a suggestion, if you turned the VS autocomplete dialogues off, I’m sure the viewer’s experience would be much better; it’s very difficult to focus on what you’re saying and typing when modal boxes are popping up and changing all over the place.

  • @adityanagarkar4326
    @adityanagarkar4326 9 місяців тому

    Here you have sampled the signal at intervals of 1. what if I want to sample it at a higher frequency?

  • @yabool2001
    @yabool2001 7 місяців тому +1

    Hi Paul. Why do you call DFT in the title when you don't show DFT at all in this video? The DFT operates exclusively on discrete sets of data and produces a spectrum comprising discrete frequency components.

    • @SignalProcessingWithPaul
      @SignalProcessingWithPaul  6 місяців тому +3

      The only way you can compute a frequency domain representation in a computer is with the DFT (the FFT is a way of computing the DFT that uses some symmetries to reduce the number of computations explicitly needed from Log(n^2) to n log2(n)).
      Since a computer cannot process an infinite number of datapoints or have infinite precision in amplitudes, you need a signal that is discrete in time and discrete in frequency to do any operation like this.
      Hope this helps

    • @yabool2001
      @yabool2001 6 місяців тому

      @@SignalProcessingWithPaul Thx for explanation.

  • @imk820
    @imk820 Рік тому

    Hi can I ask you a question?

    • @SignalProcessingWithPaul
      @SignalProcessingWithPaul  Рік тому

      Yeah sure, go for it

    • @thiagodavidmoreiramadeiros4458
      @thiagodavidmoreiramadeiros4458 Рік тому +2

      @@SignalProcessingWithPaul Hi, I am working with a sinusoidal signal made of two different frequencies that i have to find. How can i get the indexes that correspond to these frequencies when i apply the fft