From: Pete Fraser on
"Tim Wescott" <tim(a)seemywebsite.com> wrote in message
news:26Odnbyf_5N1YrbRnZ2dnUVZ_gadnZ2d(a)web-ster.com...

> Make a vector that "draws" the frequency response that you want, then take
> its FFT.

That's typically how I have done it in the past (well, DFT anyway).
It's just that I'm new to Matlab, trying to learn it, and assumed that
was what freqsamp was supposed to do.


From: Jerry Avins on
On 7/1/2010 12:17 AM, Pete Fraser wrote:
> "Jerry Avins"<jya(a)ieee.org> wrote in message
> news:BdTWn.3387$OU6.1391(a)newsfe20.iad...
>
>> What is so good about a Butterworth amplitude response that you want to
>> imitate it?
>
> Nothing.
> It's just that, under some circumstances, equipment that is
> later in the signal chain expects a Butterworth response.

Usually, that includes the Butterworth phase response. If magnitude
alone is enough, I suspect that it's just window dressing. YMMV

Jerry
--
Engineering is the art of making what you want from things you can get.
�����������������������������������������������������������������������
From: Fred Marshall on
Pete Fraser wrote:
> I'm new to Matlab, so this is probably a really dumb question.
> I'm trying to design an FIR where I can set the points.
> I want a symmetric FIR.
> I'm assuming that an N tap FIR gives me N/2 degrees of freedom
> for an even number of taps, and (N + 1)/2 degrees of freedom
> for an odd number of taps.
> This should allow me to set the frequency response at a
> number of points equal to the degrees of freedom, and
> have the frequency response travel through these points
> exactly. If I don't specify transitions that are too sharp
> relative to the number of taps, then the frequency response
> should be reasonably well controlled between the set points.
>
> I had assumed that I could use the filter toolbox's freqsamp
> method to do this, but it doesn't seem to work as I expected.
> What am I doing wrong? I'd normally do this in Mathematica
> or C, but I'm trying to get into the spirit of Matlab.
>
> I would want to solve the point setting problem anyway, but
> perhaps there's an easier way to do the immediate task that
> I wanted it for. I want to implement a Butterworth amplitude
> response in an FIR filter (to emulate some legacy equipment)
> but I can't find an easy way of doing that in Matlab (hence the
> point setting experiments).
>
> Thanks
>
> Pete
>
>

Hi Pete! How have you been?

Well, I looked into it a bit and found that I'm pretty far removed from
the filter design toolbox / notation, etc.

What have you done so far? any code samples?
What were the results?
Maybe that will get me going further.

Fred
From: Fred Marshall on
robert bristow-johnson wrote:
> On Jun 30, 10:39 pm, Tim Wescott <t...(a)seemywebsite.com> wrote:
>> On 06/30/2010 06:21 PM, Pete Fraser wrote:
>>
>>
>>
>>> I'm new to Matlab, so this is probably a really dumb question.
>>> I'm trying to design an FIR where I can set the points.
>>> I want a symmetric FIR.
>>> I'm assuming that an N tap FIR gives me N/2 degrees of freedom
>>> for an even number of taps, and (N + 1)/2 degrees of freedom
>>> for an odd number of taps.
>>> This should allow me to set the frequency response at a
>>> number of points equal to the degrees of freedom, and
>>> have the frequency response travel through these points
>>> exactly. If I don't specify transitions that are too sharp
>>> relative to the number of taps, then the frequency response
>>> should be reasonably well controlled between the set points.
>>> I had assumed that I could use the filter toolbox's freqsamp
>>> method to do this, but it doesn't seem to work as I expected.
>>> What am I doing wrong? I'd normally do this in Mathematica
>>> or C, but I'm trying to get into the spirit of Matlab.
>>> I would want to solve the point setting problem anyway, but
>>> perhaps there's an easier way to do the immediate task that
>>> I wanted it for. I want to implement a Butterworth amplitude
>>> response in an FIR filter (to emulate some legacy equipment)
>>> but I can't find an easy way of doing that in Matlab (hence the
>>> point setting experiments).
>> Make a vector that "draws" the frequency response that you want, then
>> take its FFT.
>>
>> It may not be the entirely kosher way to do it, but it certainly works.
>
> Pete might want to use the "window method". with an iFFT *larger*
> than N, draw in the frequency response, he'll get an impulse response
> that is longer than N, then window it to length N. (then maybe FFT
> back to see how bad the window mangled things.)
>
> r b-j
>

r b-j,

Well, maybe I've had it wrong all these years but I'd say that the
windowing method starts with N frequency samples where N is the length
of the filter you want. In fact, first order, it gives you a pretty
good idea of how sharp the transitions can be, etc. And, in reverse,
that suggests the length of the filter you need.

If you start with some higher freq resolution then you will be *more*
surprised if you window down to the desired N. I'd not recommend doing
it that way - but maybe there's some trick that I don't understand yet.

Anyway, having selected the frequency samples [the assumption is that
they are on a regular grid from 0 to Fs-1) there are a couple of options
of course:

1) IFFT the samples / Window in time (i.e. not just the no-op trivial
rectangular) to get rid of intersample "trillies" in frequency / FFT the
result with lots of zero-padding to see what you've really got after
windowing.

or

2) Convolve the freq samples in frequency with the sinc-like FFT of the
temporal window you have in mind to use. If the "window" function is a
lot longer than the filter sample sequence then you'll also get the
interpolated values between samples to see what you've really got in
frequency after windowing.

Fred
From: Vladimir Vassilevsky on


Pete Fraser wrote:

> "Vladimir Vassilevsky" <nospam(a)nowhere.com> wrote in message
> news:0Jidnc3knONVbbbRnZ2dnUVZ_oSdnZ2d(a)giganews.com...
>
>
>>But why would anyone want to emulate Butterworth magnitude response in a
>>linear phase FIR filter whereas it is very straightforward to do the
>>(**exact) Butterworth as IIR filter?
>
>
> Butterworth will be one of several possible responses
> from the same hardware.
>
> I'd rather not deal with Butterworth's phase issues.

Check the FDLS method of Greg Berchin. That is one of the most elegant
methods of designing to a prototype.


Vladimir Vassilevsky
DSP and Mixed Signal Design Consultant
http://www.abvolt.com