Тёмный

filtering in matlab using 'built-in' filter design techniques 

David Dorran
Подписаться 19 тыс.
Просмотров 245 тыс.
50% 1

This is a practical demonstration on how to filter a signal using matlabs built-in filter design functions. Documentation on Digital Filters is available at dx.doi.org/10.13140/RG.2.2.260....
Code used available at dadorran.wordpress.com/2013/10...

Опубликовано:

 

27 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 124   
@gohanisbuckethead
@gohanisbuckethead 10 лет назад
David Dorran, you are excellent. You really know your stuff and do a very good job, please continue.
@manhuynhkha
@manhuynhkha 10 лет назад
Perfect! You're the best teacher that I've ever seen. Good job, dude!
@Karikato
@Karikato 10 лет назад
Best explanation of the filters I've seen so far. Very good job showing the differences! :)
@rajeshbodade
@rajeshbodade 9 лет назад
Perfect! You're the best teacher that I've ever seen. Good job, Keep it up.
@TheGoodphy
@TheGoodphy 9 лет назад
Oh...This is what I "exactly" look for!! Thanks!!! It is really straightforwardly applicable now!
@mostafahoseini8888
@mostafahoseini8888 7 лет назад
Simple, straightforward and helpful! Thank you.
@ahhegab2
@ahhegab2 10 лет назад
Brilliant .. it ended my misery after suffering for a long time. Thanx Dave :)
@TheAhmedMAhmed
@TheAhmedMAhmed 10 лет назад
wonderful ! really helped me a lot in my project of my 1st Signals and Systems course; Thanks :)
@mikeshaw714
@mikeshaw714 9 лет назад
Just like to say I find all your videos on FFT/MATLAB brilliant. Very clear and concise, they have definitely helped me understand the topic, a must view for anyone wanting to learn.
@ddorran
@ddorran 9 лет назад
Thanks for the comment. It's great to know these videos are helping out.
@6400loser
@6400loser 6 лет назад
You are a goddamn life saver, David Dorran.
@seselian
@seselian 5 лет назад
You did a very good job, clear and easy to understand.
@markpage5108
@markpage5108 10 лет назад
I really like your videos, please keep doing them. I learn something from each one!
@mshahrul
@mshahrul 9 лет назад
cheers david... u help a lot of people with this
@rimzanrefaideen9168
@rimzanrefaideen9168 7 лет назад
Clear and simple. Really helped!!!!!
@mutiaaziza1394
@mutiaaziza1394 6 лет назад
perfect! very good tutorial. thank u so much Mr..
@pratyushpradhan1844
@pratyushpradhan1844 3 года назад
brilliant explanation . this is what i was looking for.
@kishonpatel7161
@kishonpatel7161 9 лет назад
thnx a lot David. ur techniques in MATLAB r really outstanding and simple to understand. we will like to have more videos of urs in future. Thnx again :)
@dinghydan
@dinghydan 9 лет назад
At last a tutorial that normal people can understand!
@stupid8154
@stupid8154 9 лет назад
a real help , cheers !!
@dongdli4708
@dongdli4708 6 лет назад
Thank you very much! It helps me a lot.
@GaiaKnight11
@GaiaKnight11 4 года назад
Thank you very much! Excellent explanation!!
@aminehaine3301
@aminehaine3301 6 лет назад
good job :) you helped me a lot for my work :)
@UtkarshSoni2512
@UtkarshSoni2512 10 лет назад
Very good tutorial :)
@sumilangovinden
@sumilangovinden 10 лет назад
Excellent Stuff
@vineeshms9561
@vineeshms9561 9 лет назад
superb....able to understand.thank you
@mariamoosa4058
@mariamoosa4058 7 лет назад
I want to remove a 50Hz and 100Hz noise from a EEG signal. For that I need to design 2 notch filters. How do i do that?
@Hyperbolicus86
@Hyperbolicus86 9 лет назад
thank you, great instruction
@rollinfever
@rollinfever 7 лет назад
Great video but I need some help! I am trying to filter a .wav audio file. I transformed it using fft( ). When I transformed it, the peak magnitude of the noise that I want to filter is around 12000 (not sure the units). How can I make this peak smaller to match your 0 to 1 magnitude which works well with the butter function you used? Or is there any way I can make a filter that has a magnitude of 12000? Thanks!
@amineleking9898
@amineleking9898 4 года назад
Thank you so much David
@ronaldinho711990
@ronaldinho711990 7 лет назад
thank you so much very useful explanation
@stephenalabi3345
@stephenalabi3345 9 лет назад
David I really appreciate ur effort. The lecture is concise, clear and easy to understand. Please can you talk about Basspass filter?
@ddorran
@ddorran 9 лет назад
I will do something on bandpass filters when I get a chance - its on the to do list! I do have an example of a bandpass filter being used in Why Linear Phase Filters are Used which might be of some help.
@hienlevan6726
@hienlevan6726 10 лет назад
Thank you so much for your useful tutorial, David. I am trying to apply filter technique for my real data which is taken every 10 minutes average of raw data including so much noise data and some missing data also. I only know the frequency of system was designed at 20Hz. Could you recommend me how to apply filter method in general and how to define the optimal order of filter and which technique in filter method is better for my case. Thank you so much for your time in advance.
@govindsahu15
@govindsahu15 6 лет назад
Sir, If we add higher order filter then there will be some delay in the signal. So, are there any methods to avoids/compensate such delay? Thanks
@KelvinLeUT
@KelvinLeUT 10 лет назад
good explanation!
@francescovatrano8687
@francescovatrano8687 7 лет назад
Hi David I used successfully what you show in this video but if it's possible i want to pose a question to you about filtered signal. I started with a signal composed by a sinusoid and noise. Than i filtered the signal by removing sinusoid . Now we have only noise and i have do demonstrate that noise have zero mean and it have a probability density function described by a Gaussian function. So I executed the command: sort(signal) in order to obtain a vector starting by lower value to higher value. Than i plotted histogram and the gaussian curve and now i have to do the ki square test but i have not idea how to do this. Can you suggest me a way? Thank you so much.
@rohandhankani3962
@rohandhankani3962 6 лет назад
TOP thank u very much sir for your help
@gmailuser7449
@gmailuser7449 9 лет назад
You are great!
@rajaduraikanniappan5327
@rajaduraikanniappan5327 10 лет назад
Hi..Thank you so much for this video. I would like to design a butterworth bandpass filter with different orders (eg. low pass filter of order 2 and high pass filter of order 8). So could you please help me, how this could be done? Thanks in advance.
@aseramohammed4597
@aseramohammed4597 4 года назад
Sir I wanna aske you about Create_signal_flow(b,a) In line 32 . What should I do to creat this function?
@kinjalmacwan4866
@kinjalmacwan4866 3 года назад
Awesome! Thanks!
@priyeshshah4750
@priyeshshah4750 10 лет назад
thanks this video really helped, I would like to know the a FIR method for filtering
@benyaminzakariah9543
@benyaminzakariah9543 8 лет назад
Hi there. I'm working on my project called Audio Compressor. How can I compress my .wav file to different factors and how to make a spectograph from it? Thank you :)
@aseramohammed4597
@aseramohammed4597 4 года назад
What does it do this function Create signal (a,b)
@sultanalhammadi2910
@sultanalhammadi2910 5 лет назад
what if there is more than frequency component and there is noise between them? how would you filter it
@MrUsamarao
@MrUsamarao 8 лет назад
Thank You Sire.. =D
@nurahmedomar
@nurahmedomar 5 лет назад
This is a Digital filter, is there any similar video about an analog filter? Thanks.
@harunyldrm2624
@harunyldrm2624 6 лет назад
Hello Engine vibration time domain data has been taken. How do I covert from time domain into crank angular domain? May you help me?
@abhimgowda8168
@abhimgowda8168 8 лет назад
sir , i am doing a project on voice recognition , can i know how to use these filters to remove the noise...please help me sir
@Rkalla251
@Rkalla251 10 лет назад
dis guy is great
@Appleiphones1
@Appleiphones1 7 лет назад
i have 3 phase voltages and current.Now how can i obtain Fundamental components of current and voltage signals using DFT?
@dipalisinha3427
@dipalisinha3427 6 лет назад
sir, i have an eeg signal with the sampling rate 173.61 , duration 23.6 second, i want to implement the band pass filter having the freq. range 0.2 to 35 hz. would u plz help me
@thepyramid9777
@thepyramid9777 7 лет назад
i need function and simulink in power system by useing kalman filter..... can you help please ?
@balotrune7499
@balotrune7499 5 лет назад
thank you so much.
@rohitkulkarni8873
@rohitkulkarni8873 10 лет назад
nice video sir...
@tdawg108
@tdawg108 9 лет назад
Thank you for your video, it was a great help. I managed to plot the amplitudes of both the Chebyshev and Butterworth filters but could you please advise me on how to plot the phase of these as well?
@ddorran
@ddorran 9 лет назад
The following should work: [H w] = freqz(b,a); plot(w,angle(H))
@jimz92raisanz
@jimz92raisanz 4 года назад
impressive, you are really helpful sir , do you have the code for the LOW PASS FILTER WITH FINITE IMPULSE RESPONSE USING LEAST SQUARE TECHNIQUE SIR
@jyotimishra473
@jyotimishra473 3 года назад
I want to apply bandpass filter on a discrete signal, can you suggest any method for that?
@hynesie11
@hynesie11 4 года назад
Thank you thank you
@mdmonazirkhalifa3997
@mdmonazirkhalifa3997 6 лет назад
Sir which version of matlab u r using
@hmir9588
@hmir9588 3 года назад
thanks sir, But what about a signal exponentially sinusoid ?! and how to eliminate dc offset and exponential term getting a pure sinusoid? actually DC offset is easy to get rid of it. Waiting for your reply for eliminating exponential term of sinusoid.
@jyothiguntamukkala9392
@jyothiguntamukkala9392 6 лет назад
sir , how to design pso for low pass lcl filter please tell
@unaihenry2964
@unaihenry2964 4 года назад
Just question ; how can i design BPF in matlab without using fir function
@tajammalnawaz5552
@tajammalnawaz5552 6 лет назад
how to set the cuttoff freq.?
@mohamadamin8122
@mohamadamin8122 8 лет назад
how to make the block diagram?
@saifalikhanpathan3422
@saifalikhanpathan3422 7 лет назад
how i can remove noise from a .wav file without using filter functions?
@jamirahamaahmed5197
@jamirahamaahmed5197 8 лет назад
I really dont know how to express my gratitude. Thanks so much! do you have videos on how to filter without built-in-functions?
@ddorran
@ddorran 8 лет назад
+Jamirah Ama Ahmed I don't have any videos explicitly on this topic. However if you understand how a systems poles and zeros influence the frequency response then you can design any discrete filter you want without having to rely on built-in functions. Take a look at ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-m5TP2uG_O2M.html
@jamirahamaahmed5197
@jamirahamaahmed5197 8 лет назад
I downloaded your pdf on basics of DSP! I always run away from Matlab during undergrad and now i need it for signal analysis etc etc for this Masters course I am taking. Your pdf is really helpful. Thank you so much. Wish I could email you or something! I am grateful!
@ddorran
@ddorran 8 лет назад
+Jamirah Ama Ahmed Thanks for letting me know my material is useful. It's nice to get that type of feedback. Good luck with your studies.
@uzidesigns23
@uzidesigns23 3 года назад
thankyou!
@vickysteev8964
@vickysteev8964 8 лет назад
Hi, i am Vicki Right now i am learning matlab, but i am just begginer at matlab, right now i want to learn about how to using low and high pass filter, Savitzky-Golay Filtering (SGOLAYFILT), mean and varians, and also find out the peak and valley point from the gyro and accelerometer signal, and all my data i get from excel. can You give me some tutorial or code how to make it I really hope You can help me to figure it out. Best Regards Vicki
@ayaibdah5646
@ayaibdah5646 2 года назад
hello can you help me in question in Image processing ?
@husseinalgusab4129
@husseinalgusab4129 10 лет назад
Thank you very much for this video David but i have a question : I have a signal and i had filtered it according to your method but there is some discrete specified frequencies ( about 100 values ) in the range of frequencies which i had already removed, so how can i add these specified frequencies (where lies in the range of removing values of frequencies ) to the original signal so as not to remove these specified values of frequencies thank you very much
@ddorran
@ddorran 10 лет назад
So you have a filter that, for example, removes frequencies in the range of 100 to 200Hz, but you now realise that you actually need to keep frequencies around 150Hz. I hope I understand you correctly. One technique you could use is to first filter frequencies from 100 to 149Hz, giving you a new signal y1. You could then pass y1 through a filter which removes frequencies between 151 and 200Hz. There are other ways of doing this but this is probably the most straight forward for someone starting out.
@husseinalgusab4129
@husseinalgusab4129 10 лет назад
Thank you very very much, i really appreciate your fast answer it's very kind of you and yes, i mean exactly what you understand thank you very much sir
@putianhe7692
@putianhe7692 10 лет назад
nice video
@lonesoldierx94
@lonesoldierx94 8 лет назад
Question: Hey, I'd like to use the freqz function and plot it simultaneously with pwelch or psd. Is that possible? I keep getting that they are not even values.
@ddorran
@ddorran 8 лет назад
+lonesoldierx94 Here's some code that'll do the job. Basically I normalised the frequency axis (see ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-2IkdNsGQgEM.html) I was expecting the output of pwelch to be the same as H^2 but for some reason it was out by a factor of 3 (that's the reason for the plot in green). I have no idea why at the moment. [b a ] = cheby1(7, 1, 0.5); H = freqz(b,a); x = randn(1, 10000); y = filter(b,a,x); P = pwelch(y,200); plot([0:length(H)-1]/length(H),abs(H).^2); hold on plot([0:length(P)-1]/length(P),P,'r'); plot([0:length(P)-1]/length(P),P*3,'g'); legend('abs(H)^2 where H= freqz(b,a)', 'psd from pwelch','psd*3')
@lonesoldierx94
@lonesoldierx94 8 лет назад
+David Dorran It works! Thank you!
@AbhilashaDAdak-iu7mw
@AbhilashaDAdak-iu7mw 7 лет назад
Do we need to enter four parameters in the 'butter' function for band pass and band reject filters?
@ddorran
@ddorran 7 лет назад
For a bandpass filter you would use [b a] = butter(3, [0.2 0.4], 'bandpass') There are still three parameters passed to the function though. Each function parameter is separated by a comma and the second parameter is an array containing two values i.e. 0.2 and 0.4. I can see why this could be described as four parameters but in terms of "function parameters" there are only three.
@AbhilashaDAdak-iu7mw
@AbhilashaDAdak-iu7mw 7 лет назад
David Dorran Thanks a ton.
@joeblow4938
@joeblow4938 8 лет назад
Is there some other tool besides MATLAB that plot these digital filter transfer functions easily?
@ddorran
@ddorran 8 лет назад
+Joe Blow You can try using Octave, Scilab or Python
@francescovatrano8687
@francescovatrano8687 7 лет назад
Can I create an high_pass filter in the same way?
@ddorran
@ddorran 7 лет назад
yes. just use [b a ] = butter(2,0.3,'high'); on line 28
@francescovatrano8687
@francescovatrano8687 7 лет назад
Thank you ;)
@aakashdeep8716
@aakashdeep8716 7 лет назад
The filter you created is of amplitude 1. How can we change the amplitude of filter, if let say I want the amplitude to be 6?
@ddorran
@ddorran 7 лет назад
You can multiply the input or the output by 6. Multiplying all the b coefficients by 6 and then filtering would have the same effect.
@aakashdeep8716
@aakashdeep8716 7 лет назад
Thanks for the support. It worked.
@aseramohammed4597
@aseramohammed4597 4 года назад
Create_signal_flow(a,b) Can you give me the code sir please
@ddorran
@ddorran 4 года назад
Its available at dadorran.wordpress.com/2012/09/26/create_signal_flow/ or by searching create_signal _flow using the search engine of your choice
@csmatyi
@csmatyi 8 лет назад
how do you determine the cutoff??? of 0.3??
@ddorran
@ddorran 8 лет назад
+Matthew Cserhati By examining the frequency content of the signal you can see that the noise occupies frequencies in the region of 0.5 to 0.8 (normalised frequency values). If you are using a low pass filter then the cutoff must be less than 0.5. By choosing a cutoff frequency less than 0.5 you will reduce higher frequencies by a greater amount. I selected 0.3 by trial an error - it reduced the noise by a visually pleasing amount that seemed to work well to illustrate the concept of filtering in the video. There are more formal ways to select the cutoff frequency and if you are interested then the following might help ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-DCCQJRJmgLo.html
@alieng3002
@alieng3002 5 лет назад
goooooooooooooooooooooood
@habibudinshams4414
@habibudinshams4414 6 лет назад
can you give me its code?
@aseramohammed4597
@aseramohammed4597 4 года назад
Please can anyone help me .
@azeemahamed3942
@azeemahamed3942 7 лет назад
how to perform for realtime bruvvvv
@MyawesumMe
@MyawesumMe 9 лет назад
and was is the "floor" for in 6:21
@ddorran
@ddorran 9 лет назад
floor rounds down to the nearest integer. It's similar to round but will always round down. For example round(1.8) = 2, but floor(1.8) =1. If the decimal part of a number is less than 0.5 then floor and round will have the same result. for example floor(10.3) = 10 and round(10.3) = 10
@mustaphaalkhafaaf5512
@mustaphaalkhafaaf5512 8 лет назад
hi ,, grate video ,,, one question though ,, after all this how can engineers go and build the filter ,, after all this is just a matlab code , we dont have a real schematics and components ??!?!?! ... cheers
@mustaphaalkhafaaf5512
@mustaphaalkhafaaf5512 8 лет назад
+Mustapha Alkhafaaf it would be useful if we have option to turn to schematics
@ddorran
@ddorran 8 лет назад
+Mustapha Alkhafaaf by writing the code you have built the filter! Take a look at ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-sTXcb3k9wf8.html. The schematic is the signal flow diagram. The components are multipliers and adders and memory which all exist in a computer and micro-controllers. In order to filter a continuous signal using a discrete filter you just need to get the signal on to the microcontroller - which is achieved using an analog to digital converter (see ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ibj_13C5dyg.html). Once the signal has been filtered by the microcontroller you can send it out of the micro using a digital to analog converter. Note that you could also build a filter using electrical components such as resistors, capacitors and op-amps.
@mustaphaalkhafaaf5512
@mustaphaalkhafaaf5512 8 лет назад
Cheer David for the explanation, you have mentioned the delay , I assume this available only in the processor with DSP capability not all micros or processors have this ... and to be honest with you i dont uderstand why do we need the delay .. why ?
@ddorran
@ddorran 8 лет назад
The delay is implemented by just storing data in memory - so all micros can implement discrete filters. The delay is a key element and filtering would not be possible without it. Look through the introductory videos to gain insight into this ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE--RM8VporjSY.html
@mustaphaalkhafaaf5512
@mustaphaalkhafaaf5512 8 лет назад
many thanks
@MyawesumMe
@MyawesumMe 9 лет назад
what is "num_bins" in 3:14 ?
@ddorran
@ddorran 9 лет назад
it is the total number of frequency bins obtained from the fft function. See Using Matlab's fft function or How the Discrete Fourier Transform (DFT) works - an overview for an explanation of the term.
@Captain_Rhodes
@Captain_Rhodes 5 лет назад
why are the normalized units pi*rad/sample? does anyone actually understand that? ive yet to see anybody explain it!
@ddorran
@ddorran 5 лет назад
There are 2 pi radians of a revolution in one cycle of a sinusoid. The maximum frequency that can be captured faithfully without aliasing will be half the sampling frequency. Therefore a sinusoid of 'maximum frequency' will have 2 samples per cycle. So over two samples the 'maximum frequency' sinusoid will have undergone 2 pi radians of a revolution, which equates to pi radians per sample.
@Captain_Rhodes
@Captain_Rhodes 5 лет назад
@@ddorran Thanks, that does make some sense. However what confuses me is that matlab says that the normalized frequency axis is defined as f/(fs/2): frequency divided by nyquist frequency. that should be units of cycles/sample right? Im starting to see what you mean, but in terms of the units I still dont get how that pi factors out
@ddorran
@ddorran 5 лет назад
​@@Captain_Rhodes fnorm=f/(fs/2). f = w/(2*pi), where w is frequency in radians per second (rads/sec). fs is frequency in samples per second (samps/sec). fnorm=w/(pi*fs), therefore units can be expressed as rads/sec/(pi*samps/sec), which reduces to (rads/samps)/pi. Another way to think about this is that fnorm*pi = w/fs, so fnorm*pi has units of rads/samp. So if fnorm is 1 and we want to express this in radians per sample we'd have to multiply by fnorm by pi. The frequency axis should actually be labelled ( x pi radians per sample) to indicate that the normalised frequency should be multiplied by pi to get the frequency in radians per sample. I hadn't noticed this omission before.
@Captain_Rhodes
@Captain_Rhodes 5 лет назад
@@ddorran Thanks for your time. its much appreciated. All the best mate
@protocolfree
@protocolfree 4 года назад
is this an analog filter ?! ( excuse my stupidity and ignorance )
@ddorran
@ddorran 4 года назад
No. It's a discrete filter.
@user-yw7mp2ls2t
@user-yw7mp2ls2t 3 года назад
Help me teacher
@mdmonazirkhalifa3997
@mdmonazirkhalifa3997 6 лет назад
Sir first define the signal 'x'
@ddorran
@ddorran 6 лет назад
It's defined in dadorran.wordpress.com/2013/10/18/filter-design-using-matlab-demo/
@chillingmeko
@chillingmeko 8 лет назад
@5:13 0.74 should be negative.
@ddorran
@ddorran 8 лет назад
+Ohmeko Ocampo It is correct. It should be positive. The reason why can be explained as follows (ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-HJEbuy4HSrM.html is a related video): The b and a coefficients are associated with the general form of a difference equation which is written as follows: a0.y[n] + a1.y[n-1] + a2.y[n-2] + a3.y[n-3] + .. ... + ak.y[n-k] = b0.x[n] + b1.x[n-1] + b2.x[n-2] + b3.x[n-3] + .. ... + bm.x[n-m] when it is rewritten with the output y[n] on the left hand side the sign of the a terms change. Letting a0 =1 the general form becomes: y[n] = b0.x[n] + b1.x[n-1] + b2.x[n-2] + b3.x[n-3] + .. ... + bm.x[n-m] - a1.y[n-1] - a2.y[n-2] - a3.y[n-3] - .. ... - ak.y[n-k]
@chillingmeko
@chillingmeko 8 лет назад
David Dorran Woah, thanks so much. I had a difficult with this. XD
Далее
Why Linear Phase Filters are Used
17:33
Просмотров 26 тыс.
Maybe a little TOO much gel 😂
00:12
Просмотров 12 млн
Designing Digital Filters with MATLAB
20:31
Просмотров 209 тыс.
DFT in Practice  - Frequency Resolution Issues
25:15
Просмотров 32 тыс.
Overview of FIR and IIR Filters
12:27
Просмотров 342 тыс.
How to design IIR & FIR Low pass Filter in Matlab??
17:33
Signal Analysis Made Easy
32:13
Просмотров 188 тыс.
Java Is Better Than Rust
42:14
Просмотров 148 тыс.
Signal Processing with MATLAB
21:11
Просмотров 106 тыс.
Signal Smoothing
3:44
Просмотров 79 тыс.