The normal design technique to design any FIR filter is to use the Remez algorithm. There are a number of software packages that implement this algorithm. In short, you define the filter characteristics to it, with a number of passbands and stopband, and different weights for these, you give the filter order, and then the algorithm finds the best matching filter for you. In practice, its used to fulfill requirements with the lowest amount of taps.
Thanks for you response Henri. I apologize for the confusion in question. "Given the frequency response of a bandstop filter (with two pass bands at wT=0 and wT=pi) , how to decompose that frequency response as sum of low pass and highpass frequency responses with passband at wT=0 for low pass filter and passband at wT=pi for highpass filter)
- I dont know of a method to split a filter in a sum of 2 filters.
- You can try to apply a transform to collapse the 2 passbands into one passband
(eg multiply with e(jwt)), but need more information to find out if that might work here.
- A FIR filter is usually linear phase, so that is not a design constraint.
- Given a filter gabarit (a set of passbands, stopbands, and weights), the best method is to use the Remez algorithm. You can use it to design ANY fir filter, with any number of stopbands and passbands, in fact any filter with any response charateristic at all. (you can eg use it to generate a filter with equalizer frequency response. If you want to do that, you will have to write your own Remez code, as the commercial and freeware codes usually only support a set of equal amplitude bands.)
- Dont understand what your problem is. Why do you want to do different, why is Remez not good enough ?. (if you dont know what it is, please look it up, there are lots of descriptions on the internet of it.)
- I have found that there is a freeware Remez plug-in for the Gnu/Linux Matlab variant. So, if you dont want to pay for it, that should not hinder you using it.
Yes you can build a wide band stop filter by a parallel combination of a low pass filter having a cut off frequency at the lower cut off frequency of the band stop filter and a high pass filter having a cut off frequency equal the higher cut off frequency of of the band top filter. Only you have to sum the outputs of the two parallel lpf and hpf.
Thanks for your response Ramesh. I am from electrical back ground, so could you let me know if that is implemented in matalab or scilab "synthesis & analysis of band stop from lpf and hpf" . Do we have matlab function for eigen filter. I understood that you are synthesising a bandstop from lpf and hpf. Correct me if i am wrong. But i need it in the other way. I have attached the frequency response of bandstop filter. Given that frequency response, i need that response as sum of lp and hp responses.
1. All the pdf,s are in scilab . I have given the code in Scilab 5.3.3.(free open ware) . The theoretical basis is in P.P.Vydyanathan "Multirate Systems and Filter banks " p53. I am a FOSS fan so not sure about Matlab library functions.
2.Yes, I synthesized bsf from lpf and hpf
3. The analysis is what you require.The conjecture is this should be possible by using hlpf = hbandstop/2 and expanding it with L=2 (ie that is add zeros in between) with another filter which is lpf of given specs.
4. What we require is an algorithm which can evaluate the filter given some coeficients and filter specification. This is an interesting problem.let me see if I can find a solution.
Incidentally nice to know you are in Electrical . I am from the 1965( heavy current)EE branch of IIT Madras , stayed at Kaveri/ Krishna hostel!
I gave you a direct answer on your question. However, you overlooked my answer. But it seems that you do not have experience in filters as you are a power electrical engineer.
But in spite of your reaction on my answer i would like to advise you to revert to the book in this site:https://www.elsevier.com/.../analog-and-digital-filter-design/.../978-0-75.
Chapter 16 in this book gives a practical method to design FIR band top filters , lpf, hpf, and bpf.
I think when one gets an answer, one has to consider it because the people spent effort to give such answer.
I apologize for the mistake. I am from Power System background so not familiar with terminology, so it takes time for me to realize the reply. Thank you for your response and valuable time. I will go through and get back to you Zekry.
Dear Henry,
I am not aware if i can use the remez algorithm , as i have frequency response(wT/pi vs magnitude) as attached in the earlier response to Ramesh. However Remez algorithm or firpm (in matlab) asks for the discrete frequencies for which we need to specify the amplitude. However i have a continuous frequency response.
Dear Ramesh,
Its pleasure to meet an alumini of IITM of 1965 batch. And i Thank you for your time in looking at the problem i have raised.
where Omeg is analogue freq in rads/sec .It is usual to normalize this into per unit freq by dividing by 2pi but here it is stated as pi. Please check as it seems that the given curve is magn vs digital frequency.
2. If it is correct that the x axis is wdigital then you can perhaps try the following
2.1 From graph normalize the magn by dividing by max value( seems about .85)
2.2 Estimate ripple dela1 pass band 1 ( about .002 from eyeball estimate) ,delta2
in stop band as delta 2( approx = .02) .
2.3 For lpf filter estimate wp =.04 ws =.1
2.4 You can use standard functions (Matlab or Scilab ) to obtain the Lpf .
2.5 Use the method described earlier in pdf for obtaining hpf
X axis is normalized frequency (*pi rad/sample) . Thank you for sharing your valuable information. I think this can help me out in decomposing. Thanks a lot.
Dear Zekri,
I am unable to get to that book . Is this the book written by Winder Steve titled "Analog and digital Filter design".
Yes, it is. I use it as one of my references in a course on Filters. I think after reading chapters 15 and 16 you will be able to fully characterize your filter, deign it which means you will be able to determine the filter coefficients and implement it by formulating its difference equation.
Please come to me back at any time.
As Narasim said you have at first to fully characterize your filter by determining its:
Sampling frequency Fs
the low cut off frequency Fl
The high cut off frequency Fh
The lower stop frequency Fsl
The higher stop frequency Fsh
The stopband attenuation Astop
From this point on you can start you deiign
The design procedure and formulas are given in the book of winder.
You may find attached pdf helpful. The actual values given by you have been used .I have used Eigen filter method in Scilab 5.3.3 code. You could use standard Scilab/ Matlab functions and se the differences because the solution may not be unique. Notethe Scilab code can be easily converted to Matlab as no special functions are used ,moreover there is a translator in Scilab.