Arduino Digital Low-Pass Filter 2.0

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

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

  • @thorntontarr2894
    @thorntontarr2894 2 года назад +23

    OK, you understood that the Python notebook inclusion in the earlier video was a non-starter so you fixed that and improved the filter at the same time. Full points awarded for your videos that are so needed for those of us that 'hack' our way to success. You have added a scientific perspective to projects. FULL Points awarded - yet again.

    • @curiores111
      @curiores111  2 года назад +3

      Well I'm glad to hear that this made sense to you Thornton. And thanks for the points 😉

  • @2903douglas
    @2903douglas Год назад +3

    In my country we have a bird called CURIÓ. This is a very popular and highly valued song bird among those who like to keep captive birds. Personally, I disapprove of this type of conduct, however, the name of your channel led me to this reflection. Thanks for sharing your knowledges. Congratulations from Brazil!

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

    I missed your videos... I think you and Phill's Lab are the best content on yt when it comes to signal processing. Thanks for sharing your knowledge.

    • @curiores111
      @curiores111  2 года назад +3

      Thanks Matheus, much appreciated. I actually have some pretty fun projects going on right now so expect more soon. 🤞

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

    Wow, where did you come from? This is so helpful, I'm going to look through how you constructed that class. I also loved the previous video on this because it put names to concepts that I need to learn, like transfer functions. That's so much more helpful for long term learning than merely providing a solution like you've done here, which I also appreciate.

  • @3bmon3em
    @3bmon3em 2 года назад +4

    Always love your videos ❤️ please keep them going. I found myself watching a lot of your videos lately as I'm working on a new robotics project.

    • @curiores111
      @curiores111  2 года назад +2

      Great to hear that Ahmed. I hope that your robotics project is going well. 🦾

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

    Amazing work! Thanks for sharing these useful filters. It would be really helpful if you could add more filters, such as a high pass, and a notch filter(band stop). Can't wait to see them implemented as well.

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

      Thanks Radan, I've had this request a couple times and sure I can implement a couple low order versions... just need to find the time..

    • @SusanAmberBruce
      @SusanAmberBruce 2 года назад +2

      @@curiores111 Hope you can find the time, I would love to see your implementation of a notch filter, I could use one for my Morse code audio receiver. 😉

  • @jaggedjagger
    @jaggedjagger 2 года назад +2

    Your voice is so amazing and calming

  • @reneoviedo3789
    @reneoviedo3789 2 года назад +1

    I love your voice is so soft and relaxing btw great video

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

    Very educational and practical, was looking at how to filter out my noisy IMU sensor.

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

      Glad to hear you found it helpful. For IMU, there are also some other pre-existing filtering code options, in case you haven't seen them.

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

    Waiting for your new videos. Your videos are very comprehensive

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

    Thank you! This video and code came in clutch for my senior design project

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

      Nice! That is exactly what I want to hear.

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

    This is just perfect. Thank you a million times! I have a question though, how can I use this (if I can) to filter out multiple analog signals on the same arduino chip?

  • @saurabhlanje1709
    @saurabhlanje1709 2 года назад +2

    This is exactly what I wanted. Thanks.

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

    Your voice is very calming

  • @osvaldorivera1897
    @osvaldorivera1897 2 года назад +2

    Curio Res you are such a wonderful woman, thank you so much really. I was testing the low pass filter in python and I had so many issues trying to make it work with the libraries and stuff, but now I can put it in real-time in Arduino and ESP32, thank you. By the way, I want to understand more about the cut-off frequency and how to choose the best sampling frequency. Let's say that I have an encoder with a PPR of 11. I want to know what frequency is best to use if I'm trying to get the RPM. I was utilizing your code with a cutoff frequency of 25Hz. But I'm not sure is the best one. Thank you again. Hope you can answer my question please.

    • @curiores111
      @curiores111  2 года назад +1

      Thank you Osvaldo. I will try to answer your question, but unfortunately it has the awful answer of "it depends". Basically the tradeoff is that if you filter the signal more, you can end up with more delay or losing some part of the original signal.
      The choice of the cutoff depends a lot on where you're using the filter. Are you using it as part of the PID control loop for velocity control?

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

      @@curiores111 I'm at the moment trying to work on a PID controller to make two motors move as straight as possible. I tried the MultipleEncoderPID program you share with us but it gave me some issues, specially with the POS (POSI) register when it overflows (mean when I substracted 1 from 0 or when I reached the max and then added 1) the controller when crazy at that point. Any ideas on how to make two motors go straight? It's a question that seems easy to solve but it's actually giving me a hell of a headache with the application I'm using. I have a 6VDC motor with Hall sensor encoder (EncA and EncB) with a PPR (Pulse Per Rotation) of 11. I have a reduction Gearbox of 1:20. The thing is that I have two wheels (7cm in radius). I'm using an ESP32 to control this two motors (PWM freq of 60Hz). This is the basic setup. Please if you could help me with a control that can make this two motors go straight that could be so much helpful. (ohh... btw I'm sending via Bluetooth and instruction to move forward that comprises of commandName:Speed(dutyPWM):Distance in #of pulses, example: MF:50:1000. This is all I think. Thank you in advance for any suggestions.

  • @farzadv2007
    @farzadv2007 5 месяцев назад

    Very good videos and useful content, please don't give up your channel

    • @curiores111
      @curiores111  5 месяцев назад

      Thank you! I appreciate the encouragement. It's difficult to put in the effort.

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

    Pretty job !!This video made me realize things I hadn't noticed before, I was wondering if there‘s a way to make Arduino data use the frequency display.

    • @curiores111
      @curiores111  2 года назад +1

      Very good question Moby... you could use an OLED display (I saw a tutorial on that once..) I was also thinking of creating something for the plotter than periodically refreshed. It would be OK perhaps? Maybe I'll write that.

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

    Great video. Beautifully illustrated. What software do you use to that? Keep post more videos.

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

      Appreciate that! I used camtasia.

  • @user-wm4it7xv8t
    @user-wm4it7xv8t Год назад

    Wow so wonderfully explained. Iam working on a project to calculate entropy of fault signal from analog signals using DWT. So its uses 3 level decomposition using DB4. So series of high pass and low pass filters also reconstructing the signal again. Trying to implement it on arduino in real time. Can you please throw some light on that. Thanks

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

    What kind of cutoff would you use for sampling an audio range of 10Hz to 20Khz? around 40Khz? Beings that it's a 1st or 2nd order the slope will be fairly smooth so perhaps a bit more closer to 20Khz?

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

    Such a clear explanation, thank you!

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

    Hi! Your video and code helped me with in an academic work I'm doing for my college, but how can I reach you to give it the proper credits?

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

    Thank you so much for such usefull contents. I also want to thank you for the amaizing application to plot from the serial data

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

      Well of course, thanks for stopping by 😊

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

    wish I was that smart, thanks for the code!

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

      Certainly, and thanks for dropping by.

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

    Great video as always. Question:. What is the difference between using Z transform difference equation vs convolution with an impulse response filters?

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

      No difference if the impulse response characterizes the same filter

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

    omg thank you so much.. your examples are gold!

    • @curiores111
      @curiores111  2 года назад +1

      Too kind Leo. Thanks for stopping by.

  • @annboi3496
    @annboi3496 2 года назад +1

    Amazing work, it works perfectly for my pulse sensor, +1 sub ! Thank you so much ! Can you give us the transfer function to justify the numerics coefficient a[ ], b [ ], and c[ ] because the coefficients for 1 and 2 ordre butterworth that I found in the internet are different. I need it for my university project.

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

    Hi, This is a nice tutorial. I am new in this. I am using BNO055. I want to detect the displacement out of linear acceleration data. How can I use the filter. The acceleration data comes out as a sin curve, deriving velocity out of that cause 0 displacement. Could you please guide. Thanks in advance

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

    Amazing and apt explanations! Thankyou for this vedio.

  • @j.g.holstein2125
    @j.g.holstein2125 2 года назад

    Hi Curio, very nice video! I like to use it for my morse decoder as noise filter the Pitch is at 683 Hz can you help with this? Best regards, Johan

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

    Good job, hope to see more of your videos!

    • @curiores111
      @curiores111  2 года назад +1

      Thanks Smith! working on one as we speak, so stay tuned 😉

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

    Hey! I know you said you don't have the time to do it, but how would you find the difference equations and stuff for a high pass filter in Jupyter? The only difference would be the continuous transfer function right? Then the bilinear transform and filtering code would still be the same im assuming.

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

      Hi MirakekkLe!
      Yes, the process for constructing the discrete form would be the same. When did I say I didn't have the time? I mean I know I probably did I just don't remember when...
      Anyways, your comment convinced me to put the high-pass version together. Maybe I'll make a short info video about it... in any case you can find the Python files here:
      github.com/curiores/ArduinoTutorials/tree/main/BasicFilters/Design/HighPass
      and the Arduino implementation:
      github.com/curiores/ArduinoTutorials/blob/main/BasicFilters/ArduinoImplementations/HighPass/HighPass.ino
      Let me know if you find any issues...
      CR

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

      ​@@curiores111 That's super cool! I'm actually doing a Circuits/Signals College Lab final project based around your work, where I'm expanding into a high pass and bandpass filter, along with creating my own bilinear transform function and expanding heavily on the math and basic concepts more (for people who don't know anything about signals). This is literally so fun for me. You're such an awesome inspiration! I'll let you know if I need any more assistance. Thanks.

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

      @@curiores111 One thing that I did forget to mention, do you by any chance have the Butterworth high pass filter code for Arduino? I only saw the standard high pass on Github. Also, what would I do to implement a bandpass filter? I would basically just combine the python/arduino codes right? Thanks

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

      @@mirakekkle9476 Great to hear that! I also find DSP to be a very interesting area to explore.
      The Butterworth 2nd order derivation is here:
      github.com/curiores/ArduinoTutorials/blob/main/BasicFilters/Design/HighPass/Analytic%20Derivation%20for%20High%20Pass.ipynb
      The implementation is here at line 46:
      github.com/curiores/ArduinoTutorials/blob/main/BasicFilters/ArduinoImplementations/HighPass/HighPass.ino
      ...and the more general python code is here:
      github.com/curiores/ArduinoTutorials/blob/main/BasicFilters/Design/HighPass/Butterworth-HighPassFilter.ipynb
      To answer your other question, yes, the bandpass derivation would be similar. Instead of doing the substitution s -> omega_c/s or s-> s/omega_c, you do a substitution like Q(s/omega_0 + omega_0/s)... have a look at this wiki: en.wikipedia.org/wiki/Prototype_filter
      Also if you're digging into the high pass filter, I noticed some pretty substantial transients for Butterworth order >=4, would be interesting to understand those, and what type of filter design would avoid them. Here I assume they're a real artifact and not a problem in my derivation.

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

    Excellent .. please keep uploading great content

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

    @curriores111, it's amazing work you're doing.
    However, i am using your software Serial Analyzer with a MPU 6050 on arduino. but it does not work. I can't see the input signal on my screen.
    Can you helps me

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

      @curiores111

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

      Appreciate that. I'd be happy to try to help, but it's difficult to say without knowing more about what you've done so far.
      Are you printing your output to the serial port in the right format? Have you been able to view that in the Serial Plotter? The format required by the Serial Analyzer is the same as the Serial Plotter, so that could be a good place to start.

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

    how to use it with multiple sensors?

    • @curiores111
      @curiores111  2 года назад +1

      Create multiple instances of the class

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

      @@curiores111 thank you

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

    i still can't shake my head off the fact ur implementing dsp in arduino..😅..it would be more nice of you if you can make a detailed videos on dsp.....like iir and fir filters......

    • @curiores111
      @curiores111  2 года назад +1

      Thanks for the suggestion... I'll see if I can think up an interesting story to tell with some of the more serious DSP.

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

    Found a gem today.

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

    Very good sharing. Thank you.

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

    how do i pass an audio file as the input

  • @OMNI_INFINITY
    @OMNI_INFINITY 3 месяца назад

    Learning filter DSP today. Chatgpt has been saying a buffer isn't necessary, so is that poppycock or legit? Seems ridiculous that the filter code it output could know what frequency it is filtering if it doesn't have a buffer to read to know what frequency. Is "float wc = 2 * M_PI * cutoffFrequency / SAMPLE_RATE;" somehow enabling the code to do that somehow?

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

    Could you explain what is "micros()" in line 34. this function is called there but not defined in the code

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

      micros is a built in arduino function, (approximate) time elapsed in microseconds. Here's the reference www.arduino.cc/reference/en/language/functions/time/micros/

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

    Wow, this is awesome!

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

    increible!!! muchas gracias!!

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

    Hello, can you explain or give an example on how I can add another "instance of the class" in order to filter a second signal?

    • @curiores111
      @curiores111  2 года назад +1

      absolutely, here you go:
      [global before setup]
      // Filter instances
      LowPass lp(3,1e3,true);
      LowPass lp2(5,1e3,true); // here's your other instance
      [inside loop]
      // Compute the filtered signals
      float yFilt = lp.filt(y);
      float zFilt = lp2.filt(z); // here's the other instance being used

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

      @@curiores111 AMAZING! Thank you!

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

      @@jackyleong7740 No problem 😉Thanks for stopping by.

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

    Very well done :-) subscribed

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

    How to interpret the ip vs op?
    I’m learning dsp and fir filters.
    Please help

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

      Care to elaborate on ip and op?

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

      @@curiores111 I think he means ip for input and op for output.

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

    that is amazing. but can you help us for uploading the file again at your git hub account. because we found that error

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

      Ah yeah one here too huh, well let me know if it's not working still.

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

      @@curiores111 Thank you it works right now

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

    In 0:45 to 1: 20 you show coefficient for a first order filter, what are coefficients for second order filter ?

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

      You can calculate them with the script.

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

      @@curiores111 from where I can get it ?

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

      @@poshkin6287 From the GitHub, they are linked in the description

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

      @@poshkin6287 Oh sorry, wrong video. The coefficients are automatically calculated in that one. You can calculate them using the Arduino code.

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

    Love you. Thanks.

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

    So good.

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

    Amazing. Subbed!!!!

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

    You are great !!

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

    Awesome!!! like always...

    • @curiores111
      @curiores111  2 года назад +1

      Hey thanks DJ red rover. You're actually part of the reason I made this one. It's just a small piece that's part of a larger project, but I want to keep some things going on the channel. Trying to stay in it.

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

      @@curiores111 Awesome!!! glad I can be of some motivation. Can't wait for the next one!!

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

      @@curiores111 Thank you for the time and effort it takes to make these videos. This is one of my favorite channels. The adaptive sampling frequency is nifty!

    • @curiores111
      @curiores111  2 года назад +1

      @@markday3145 Certainly Mark and I appreciate you stopping by for this humble entry. 😊

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

    very good video.

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

    Amazing 👌

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

    👏👏👌🥰

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

    You're cheating, if you have to do the exercises you have to do them by hand, otherwise you're cheating, you can do some things with the calculator but not everything, it has to be done by hand.