I am trying to understand filter design. I am trying to implement butterworth filter which would have high,low and bandpass using the difference equation representation for FIR and IIR. Given the low and high cutoff frequency, how can I formulate the coefficients for FIR and IIR filter?
Marcus provided an excellent link in the comments under the questions for the underlying details.
If you just need the filter and not the underlying details in how to design it from scratch, (or to confirm your own understanding), you can get the coefficients from python using
scipy.signal.butter, or similarly from MATLAB/Octave using
butter. As Marcus indicated, the Butterworth filter has poles and zeros so must be an IIR to implement as a digital filter. If you want a linear phase FIR filter (which is referred to as "all zeros" as it's poles are all at the origin) use
firpm in MATLAB/Octave).