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.
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!
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.
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 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. 😉
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?
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.
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?
@@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.
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.
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.
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
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?
Great video as always. Question:. What is the difference between using Z transform difference equation vs convolution with an impulse response filters?
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.
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
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.
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
@@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.
@@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
@@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.
@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
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.
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......
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?
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/
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
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.
@@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!
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.
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.
Well I'm glad to hear that this made sense to you Thornton. And thanks for the points 😉
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!
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.
Thanks Matheus, much appreciated. I actually have some pretty fun projects going on right now so expect more soon. 🤞
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.
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.
Great to hear that Ahmed. I hope that your robotics project is going well. 🦾
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.
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..
@@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. 😉
Your voice is so amazing and calming
😊
I love your voice is so soft and relaxing btw great video
Well thank you 😊
Very educational and practical, was looking at how to filter out my noisy IMU sensor.
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.
Waiting for your new videos. Your videos are very comprehensive
Thank you! This video and code came in clutch for my senior design project
Nice! That is exactly what I want to hear.
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?
This is exactly what I wanted. Thanks.
Excellent!
Your voice is very calming
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.
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?
@@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.
Very good videos and useful content, please don't give up your channel
Thank you! I appreciate the encouragement. It's difficult to put in the effort.
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.
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.
Great video. Beautifully illustrated. What software do you use to that? Keep post more videos.
Appreciate that! I used camtasia.
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
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?
Such a clear explanation, thank you!
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?
Thank you so much for such usefull contents. I also want to thank you for the amaizing application to plot from the serial data
Well of course, thanks for stopping by 😊
wish I was that smart, thanks for the code!
Certainly, and thanks for dropping by.
Great video as always. Question:. What is the difference between using Z transform difference equation vs convolution with an impulse response filters?
No difference if the impulse response characterizes the same filter
omg thank you so much.. your examples are gold!
Too kind Leo. Thanks for stopping by.
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.
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
Amazing and apt explanations! Thankyou for this vedio.
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
Good job, hope to see more of your videos!
Thanks Smith! working on one as we speak, so stay tuned 😉
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.
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
@@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.
@@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
@@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.
Excellent .. please keep uploading great content
Thank you 😊, I will try
@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
@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.
how to use it with multiple sensors?
Create multiple instances of the class
@@curiores111 thank you
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......
Thanks for the suggestion... I'll see if I can think up an interesting story to tell with some of the more serious DSP.
Found a gem today.
Very good sharing. Thank you.
how do i pass an audio file as the input
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?
Could you explain what is "micros()" in line 34. this function is called there but not defined in the code
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/
Wow, this is awesome!
increible!!! muchas gracias!!
De nada Martin 💖
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?
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
@@curiores111 AMAZING! Thank you!
@@jackyleong7740 No problem 😉Thanks for stopping by.
Very well done :-) subscribed
Thank you 😊
How to interpret the ip vs op?
I’m learning dsp and fir filters.
Please help
Care to elaborate on ip and op?
@@curiores111 I think he means ip for input and op for output.
that is amazing. but can you help us for uploading the file again at your git hub account. because we found that error
Ah yeah one here too huh, well let me know if it's not working still.
@@curiores111 Thank you it works right now
In 0:45 to 1: 20 you show coefficient for a first order filter, what are coefficients for second order filter ?
You can calculate them with the script.
@@curiores111 from where I can get it ?
@@poshkin6287 From the GitHub, they are linked in the description
@@poshkin6287 Oh sorry, wrong video. The coefficients are automatically calculated in that one. You can calculate them using the Arduino code.
Love you. Thanks.
😊 good to see you Mist!
So good.
Amazing. Subbed!!!!
You are great !!
Awesome!!! like always...
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.
@@curiores111 Awesome!!! glad I can be of some motivation. Can't wait for the next one!!
@@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!
@@markday3145 Certainly Mark and I appreciate you stopping by for this humble entry. 😊
very good video.
Thanks Ahmet 😄
Amazing 👌
Thank you Tahir.
👏👏👌🥰
😊😊
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.