Denoising Data with FFT [Matlab]

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ธ.ค. 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?

  • @rippking3167
    @rippking3167 8 หลายเดือนก่อน +1

    absolutely amazing video!

  • @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.

  • @ulquiorra3504
    @ulquiorra3504 2 ปีที่แล้ว +5

    This video was just a life saver. Thanks, Steve

  • @tharunkumar6823
    @tharunkumar6823 3 ปีที่แล้ว

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

  • @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!

  • @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.

  • @HellOnGames
    @HellOnGames 2 ปีที่แล้ว

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

  • @SoumilSahu
    @SoumilSahu 2 ปีที่แล้ว

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

  • @philparisi_
    @philparisi_ 3 ปีที่แล้ว

    Brilliant work, Steve!

  • @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.

  • @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).

  • @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.

  • @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.

  • @sureshmscau7
    @sureshmscau7 2 ปีที่แล้ว

    Very nicely explained. Thanks a lot.

  • @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.

  • @JamilKazi-rj2ny
    @JamilKazi-rj2ny 7 หลายเดือนก่อน

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

  • @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?

  • @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.

  • @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

  • @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!

  • @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.

  • @inretrograde11
    @inretrograde11 4 ปีที่แล้ว

    best video ive seen on this thank u

  • @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) .

  • @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.

  • @matthewjames7513
    @matthewjames7513 3 ปีที่แล้ว

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

  • @flow.dance.studio8850
    @flow.dance.studio8850 2 ปีที่แล้ว

    Fantastic video - thanks!

  • @gzitterspiller
    @gzitterspiller 4 ปีที่แล้ว

    Why do you drop half od the freq spectrum?

  • @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)

  • @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?

  • @ahmadmashal7120
    @ahmadmashal7120 3 ปีที่แล้ว

    very clear and usefull
    thank you

  • @ElMalikHydaspes
    @ElMalikHydaspes 10 หลายเดือนก่อน

    lambda transpose would be lambda Hermitian, no?

  • @jeasonjose6185
    @jeasonjose6185 4 ปีที่แล้ว

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

  • @sagan61
    @sagan61 7 หลายเดือนก่อน

    how can I do something similar in real time?

  • @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?

  • @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!

  • @SaramAbbas1
    @SaramAbbas1 3 ปีที่แล้ว

    HOW DO YOU WRITE?

  • @masoomverma3195
    @masoomverma3195 3 ปีที่แล้ว

    Thankyou so much you are life saviour .

  • @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.

    • @mokranemokrane1941
      @mokranemokrane1941 4 ปีที่แล้ว

      That would be very beneficial. Thanks in advance..

  • @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?

  • @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.

  • @anilkumar-kv4we
    @anilkumar-kv4we 4 ปีที่แล้ว

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

  • @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?

  • @thisaintmyrealname1
    @thisaintmyrealname1 3 ปีที่แล้ว

    beautiful. just beautiful.

  • @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 :)

  • @Thegravyipass
    @Thegravyipass 4 ปีที่แล้ว +5

    I wish you were my instructor.

    • @Eigensteve
      @Eigensteve  4 ปีที่แล้ว +1

      That is really kind of you to say

  • @Lunnauna
    @Lunnauna 3 ปีที่แล้ว

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

  • @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.

  • @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?

  • @uzmahussain9794
    @uzmahussain9794 4 ปีที่แล้ว

    You are amazing!

  • @HernandezLopezPedro
    @HernandezLopezPedro ปีที่แล้ว

    amazing!!!!

  • @fabioestebanmonsalves9574
    @fabioestebanmonsalves9574 2 ปีที่แล้ว

    BRAVO !

  • @amribrahim7850
    @amribrahim7850 2 ปีที่แล้ว

    Amazing

  • @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!!!!!