Denoising Data with FFT [Matlab]

Поделиться
HTML-код
  • Опубликовано: 31 дек 2024
  • НаукаНаука

Комментарии • 84

  • @Dominicwylai
    @Dominicwylai 3 года назад +1

    The quality of this video is amazing... When he first started writing on the glass, i thought "Wow, his mirrored handwriting is amazing... "

  • @merrickmorgan6890
    @merrickmorgan6890 4 года назад +14

    In my second semester of EE and fell down a rabbit hole of looking at fourier transforms because I saw laplace transforms on a formula sheet for my electrical systems 1 course. This video was super helpful. I, with my almost 0 coding experience, feel like I could parse this together in matlab with your video as a guide and understand what is happening in each step. You are a great instructor!

    • @ZAIDAAS99
      @ZAIDAAS99 Год назад +1

      hi. im in second semester right now hahaha. can you give an update? lmao

    • @merrickmorgan6890
      @merrickmorgan6890 Год назад +1

      @@ZAIDAAS99 lol, I just graduated with a degree in pure math. Didn't end up liking my faculty in EE. 🙏🏾 I hope you enjoy your program!

    • @onelivingsoul2962
      @onelivingsoul2962 Год назад

      ​@@merrickmorgan6890Nice.
      Will you pursue domain related to computer science involving Mathematics?

  • @ulquiorra3504
    @ulquiorra3504 2 года назад +5

    This video was just a life saver. Thanks, Steve

  • @PaperMooooon
    @PaperMooooon 3 года назад

    Huge help. Background in machine learning but know nothing of eeg analysis. This was extremely helpful for just getting the basics of how the data is handled.

  • @rippking3167
    @rippking3167 8 месяцев назад +1

    absolutely amazing video!

  • @RockingThePlanet
    @RockingThePlanet 9 месяцев назад

    Excellent Recap.. thank you.. been a while since I got into this.. nice to have a well timed, well made super efficient lecture!

  • @tharunkumar6823
    @tharunkumar6823 3 года назад

    very good explaination steve,you are making things so easy,from INDIA big thank you

  • @SoumilSahu
    @SoumilSahu 2 года назад

    This almost seems like magic, especially seeing how well it works!

  • @HellOnGames
    @HellOnGames 2 года назад

    Wow! Really high quality video and teaching technique with the clean sci-fi looking screen. Thanks for all the information.

  • @Musiclover5258
    @Musiclover5258 Год назад +1

    I think I have figured the answer. To be exactly consistent with the original Fourier Series definition, the division by n should be clubbed with the the DFT expression, rather than the inverse DFT expression. In the line of code for calculating PSD, both fhat and conj(fhat) should therefore be divided by n, thus a total divisor of n^2. If we do that then the spikes in the FFT plot, at 50 Hz and 120 Hz, will each show a height of 0.25 Watts. The remaining 0.25 Watts go to spikes at the respective negative frequencies - which would trace around the unit circle clockwise, and appear at the same frequency distances from the end of the plot if the entire graph with 1000 points is displayed. Thanks.

  • @philparisi_
    @philparisi_ 3 года назад

    Brilliant work, Steve!

  • @lavanyat6143
    @lavanyat6143 4 года назад

    Dear Steve,
    At times, the energy level of unvoiced speech sounds and noise will remain the same. In that case, unvoiced sounds will be unheard (especially at low SNR regions).

  • @sureshmscau7
    @sureshmscau7 2 года назад

    Very nicely explained. Thanks a lot.

  • @Musiclover5258
    @Musiclover5258 Год назад

    Thank you Professor Steve Brunton for such a great video series, with the concepts being so lucidly explained. A quick question. Your original clean signal has a power of 0.5 Watt at 50 Hz and another 0.5 Watt at 120 hz. When you calculate the PSD (at around 4:20 min in the video), you are dividing by n, and that makes it consistent with Parseval's theorem for the digital version. And yet, the PSD plots show huge spikes close t0 250 (Watts?) at these two frequency points. I guess I am getting my units mixed up, but not sure how; I'll appreciate your advice. Thanks gain.

  • @jaikumar848
    @jaikumar848 4 года назад +6

    It is really great video sir ! Could you please make video on practical applications on z transform ?

    • @Eigensteve
      @Eigensteve  4 года назад +4

      Thanks! This is a nice suggestion. I will probably have something on the Laplace transform soon, and then I can think about adding something on the z-transform.

  • @lionmuller2680
    @lionmuller2680 2 года назад

    Nice visualization of this method. However it would be interesting to see the Signal-to-noise ratio in this example in order to indicate how much power the signal and the noise contain. This would be a great addition to the PSD which is already mentioned.

  • @inretrograde11
    @inretrograde11 4 года назад

    best video ive seen on this thank u

  • @anilkumar-kv4we
    @anilkumar-kv4we 4 года назад

    Thanks a lot...its re define my understanding on FFT

  • @lernenmitrobin
    @lernenmitrobin 4 года назад +2

    Nice work again! Maybe you could add some words about parseval's theorem in the next video about fourier transform by using fft. In this case: When you "zoom" into ffilt and catch one period by the smallest frequency, so 50Hz, the integral of the squared signal must be equal to the sum of PSDclean. Maybe I forgot a factor of 2pi or something like this, but you know what I mean. By using the raw signal, you can calculate the power of the noisy signal vice versa with the difference ;-)
    Thanks for the powerful input sir!

    • @Eigensteve
      @Eigensteve  4 года назад

      Great input -- I'd like to bring this in sometime in the future!

  • @JJGhostHunters
    @JJGhostHunters Год назад

    How would this be done with an arbitrary real signal instead of a contribed signal built from timesteps? In other words, how would we establish the time steps and frequency steps from an actual signal?

  • @masoomverma3195
    @masoomverma3195 3 года назад

    Thankyou so much you are life saviour .

  • @flow.dance.studio8850
    @flow.dance.studio8850 2 года назад

    Fantastic video - thanks!

  • @JamilKazi-rj2ny
    @JamilKazi-rj2ny 7 месяцев назад

    interested to know how you make the video setup for making this kind of videos

  • @theBlaxicindasian
    @theBlaxicindasian 4 года назад

    On line 19 you compute a DFT with n coefficients. Shouldn't the corresponding frequency grid on line 21 be computed as 1/(dt*t)*(0:n-1) so that it is also length n? This does not affect the final result since you don't consider anything past the Nyquist frequency, but it seems like the FFT does not actually generate a Fourier coefficient corresponding to the sampling frequency.

  • @ahmadmashal7120
    @ahmadmashal7120 3 года назад

    very clear and usefull
    thank you

  • @sajidhaniff01
    @sajidhaniff01 4 года назад +2

    Thanks for your amazing videos!
    Steve, why divide the psd by n? It’s already the magnitude squared. .. for plotting?

    • @lionmuller2680
      @lionmuller2680 2 года назад

      It actually belongs to the line before. Or according to the definition of the DFT which is the transformation performed by the fft this 1/n rather belongs to the inverse transform.

  • @yasserothman4023
    @yasserothman4023 3 года назад

    May I know what is L in the code you shared Line 22 and why is it calculated that way ?
    Also what is he significance of the phase of the Fourier coefficients ?

  • @ing.erickosorio2887
    @ing.erickosorio2887 4 года назад

    hi Professor Brunton, I'm actually a Civil Engineer specializing in seismic Engineering I've been told by many people that we process earthquakes by using FFTs, however, Earthquakes are random in nature, so all can do it's get a bunch of data of acceleration/displacement vs time, but those are just numbers it's not like we can create a nice function like the one you have in this example, all we have is data, how would the FFT be implemented in that situation? since it's my understanding that it is what we are supposed to use. Thanks, great video.

    • @felixbrandle9398
      @felixbrandle9398 4 года назад

      The procedure should be the same, since line 4 to 7 are only used to generate data. Later in the actual FFT-part we use the generated data to filter out noise. The true function isn't needed. The only thing you must do is to replace the f in line 7 with your own data, and maybe scale the values and frequencies, if your time isn't normalized. The filtered data can now be analyzed or used to fit a model.

    • @ing.erickosorio2887
      @ing.erickosorio2887 4 года назад

      @@felixbrandle9398 thank you so much

  • @shyangmawlim3704
    @shyangmawlim3704 4 года назад +1

    I tried to fft my own signal, set zeros for the frequencies above a predefined value, and then ifft to get the filtered signal in time domain. I noticed that the output of ifft is complex number for my data. Can anyone explain why that happens? It seems that if I use 'symmetric' flag in the ifft, I got real number.

  • @kashyapachandra6794
    @kashyapachandra6794 4 года назад +1

    Sir,
    Please make a video explaining the algorithm for FFT. That is, how to perform FFT without the function but with our own code. Thank you.

  • @matiaharonyan5218
    @matiaharonyan5218 3 года назад

    Steve this explanation is amazing. Why do you need line 22?

    • @lionmuller2680
      @lionmuller2680 2 года назад

      It‘s there to obtain the single-sided spectrum of the fft. The fft will actually result in a two-sided spectrum. This is due to the nature of the underlying DFT which results in a periodic transform of the sampled signal. Therefore the fft returns a spectrum which is symmetric and we have redundant frequencies that we don‘t need. Although this is only due to the fact that the signal in this example is real valued. Also to note is that this single-sided spectrum should be multiplied by two in order to preserve the signal power.

  • @sivaprasadg4
    @sivaprasadg4 4 года назад

    What if the data is too noisy and not able to find a threshold for PSD to filter? This happens if we change the multiplication factor from 2.5 to 10. Is there any way to recover the signal from such noisy data?

  • @epicmorphism2240
    @epicmorphism2240 4 года назад

    I wonder if you could help me. I have an audio of a bird and I want to find out in wich notes it sings wirh the FFT. How can I do it? And how can I import the audio kn matlab?

  • @mohammadalibahrami1253
    @mohammadalibahrami1253 4 года назад

    Thanks for your concise explanation. I'd appreciate if you made it clear that why just half of frequencies are plotted? (Due to line 22 of your code)
    Is it related to the theory of Nyquist?

    • @jkengineeringworkvideos7282
      @jkengineeringworkvideos7282 3 года назад

      Yeah its got to with the sampling frequency being half the highest frequency of the signal (basically Nyquist)

  • @christiangregan9996
    @christiangregan9996 4 года назад

    Hi Steven, great video. Was wondering what king of setup you have for recording your videos - more interested on how you layout the code and use your marker to write like a whiteboard at university. Thanks!

  • @WafflerMark
    @WafflerMark 2 года назад

    How can FFT's be used with fractal stock market data? My interest would be knowing in what degree cycle (wave) the mkt is in. Say, the mkt is in a bull phase, but currently heading down. If the mkt is going to go up 3 times, but have 2 down phases in between, and those down phases consist of a down-up-down sequence, and it's currently in the up phase of our down-up-down within a down of a larger up-dn-up-dn-up sequence, how can an FFT tell me if I'm in a small/corrective up or a big up?

  • @jeasonjose6185
    @jeasonjose6185 4 года назад

    thank you sir, This video is very helpful, what are the other Filters that we can use for Denoising?

  • @gzitterspiller
    @gzitterspiller 4 года назад

    Why do you drop half od the freq spectrum?

  • @Lunnauna
    @Lunnauna 3 года назад

    this is amazing, thank u so much!!!!

  • @matthewjames7513
    @matthewjames7513 3 года назад

    Why only plot the fist half of the frequencies?
    L = 1:floor(n/2) ?

  • @shashidharmuniswamy2620
    @shashidharmuniswamy2620 3 года назад

    Hello, Prof. Steve, thank you so much for the video. I have a question: after multiplying by the conjugate, don't you have to take the square root of the value? If yes, then can't I just find the absolute value of the complex number?

    • @drewmcillwain3605
      @drewmcillwain3605 3 года назад

      No, you do not need to take the square root because you are not interested in the magnitude. The magnitude squared still produces the results of finding what frequencies have the most power. Also, the absolute value of a complex number does not yield the magnitude. a +b does not equal sqr(a^2 +b^2) .

  • @thisaintmyrealname1
    @thisaintmyrealname1 3 года назад

    beautiful. just beautiful.

  • @sagan61
    @sagan61 7 месяцев назад

    how can I do something similar in real time?

  • @ElMalikHydaspes
    @ElMalikHydaspes 11 месяцев назад

    lambda transpose would be lambda Hermitian, no?

  • @fabioestebanmonsalves9574
    @fabioestebanmonsalves9574 2 года назад

    BRAVO !

  • @adamlevschuk571
    @adamlevschuk571 4 года назад

    Hi Steve, thanks for another great explanation -- videos are really helping me out. How would I then calculate the area under the PSD curve?

  • @uzmahussain9794
    @uzmahussain9794 4 года назад

    You are amazing!

  • @HernandezLopezPedro
    @HernandezLopezPedro Год назад

    amazing!!!!

  • @SaramAbbas1
    @SaramAbbas1 3 года назад

    HOW DO YOU WRITE?

  • @Thegravyipass
    @Thegravyipass 4 года назад +5

    I wish you were my instructor.

    • @Eigensteve
      @Eigensteve  4 года назад +1

      That is really kind of you to say

  • @kgeagles95
    @kgeagles95 4 года назад

    Loved the video! I have a brief question, though. Since the noise we add to fclean is random and fairly large w.r.t the signal itself, when I run the code several times the PSD spikes at 50 and 120 Hz are often not the same in height. I imagine this is because the noise itself is modulating the values of the PSD at all frequencies, including those we actually want to isolate (the 50 and 120 Hz). Therefore, although the f_filt signal has the right features of fclean, when I compute the rms error between the two, there is a moderately sized error ranging from 0.15-0.25, whereas the max(abs(fclean)) is ~1.95. My question is how, if at all, can you improve the denoising process to decrease this rms error between f_filt and fclean? Or is this not possible in a real-world scenario since 1) we would not have control over the noise magnitude and 2) we would not know fclean a priori?

    • @lionmuller2680
      @lionmuller2680 2 года назад

      As you have already said yourself the noise may increase the power of the frequencies from the clean signal. So in the power spectrum the peaks might have different magnitudes with respect to the original magnitude when the signal wad constructed.

  • @NetTubeUser
    @NetTubeUser 2 года назад

    That was really interesting, thank you! I use the FFT plugin in Adobe Audition but also use a free plugin FFT filter sometimes to get rid of some moiré, and scan patterns with Photoshop. By the way, I'm just curious and intrigued ... how can you write not in reverse on your glass, please? Haha!

    • @AbrarShaikh2741
      @AbrarShaikh2741 2 года назад

      He records in Normal transform (from the back) and then applies Inverse Video Transform (flips the video) 😂

    • @NetTubeUser
      @NetTubeUser 2 года назад

      @@AbrarShaikh2741 HA! Of course ... DUH! ... I'm stupid, haha! Thank you for your answer, I appreciate it.

  • @amribrahim7850
    @amribrahim7850 2 года назад

    Amazing

  • @afaque09
    @afaque09 4 года назад

    Could anyone give me a source on how to implement FFT to decompose 2D PIV data. Basically number of 2d vector fields acquired over a time span. Each field itself is a matrix, and at each node there can be two to three components (u v w).
    I intend to find high frequency isotropic turbulence.

  • @alexeyl22
    @alexeyl22 4 года назад +1

    Conversely, adding noise will scramble the signal 😂.
    Also, is it true that 2D FFT will result in the same f^ for any affine rotation of the 2D signal?

  • @akuladhanush7314
    @akuladhanush7314 4 года назад

    can we use an audio file instead of signal with sum of two frequencies?

    • @concinnity9676
      @concinnity9676 4 года назад

      Dear Akula, yes, you can use an audio input. You may use many inputs. He is showing a general idea, which is used in many signal processing applications. I might suggest that after his "limiting filter" , one might apply a sequence of low frequency reject filter, and high frequency reject. (Listen only to frequencies you wish). Latency and phase distortion are likely not an issue for audio. These techniques are also very effective when the input data comes in something else than time. "Sample your data as fine as you can in the dimension you care about, DSP can analyze." (says DSP engineer).

    • @akuladhanush7314
      @akuladhanush7314 4 года назад

      @@concinnity9676 thankyou :)

  • @jemussi7842
    @jemussi7842 3 года назад

    So we're watching a LR flipped image of you since we see the writing the correct way round.

  • @marcoflores1764
    @marcoflores1764 4 года назад

    You explain this very well. I just don’t have the background to understand certain parts. Are you writing in reverse as you’re explaining this? Are you even human? 😆

  • @mahmudurrahman1696
    @mahmudurrahman1696 4 года назад

    basically fft is just SVD

  • @myoung1445
    @myoung1445 3 года назад

    Two tone 😳

  • @jameshopkins3541
    @jameshopkins3541 Год назад

    MFULL. NOLIKE!!!!!