Sign in

username:

password:



Not a member?

Search compdsp



Search tips

comp.dsp by Keywords

Adaptive Filter | ADPCM | ADSP | ADSP-2181 | Aliasing | AMR | Anti-Aliasing | ARMA | Autocorrelation | AutoCovariance | Beamforming | Bessel | Blackfin | Butterworth | C6713 | CCS | Chebyshev | CIC Filter | Circular Convolution | Code Composer Studio | Comb Filter | Compression | Convolution | Cross Correlation | DCT | Decimation | Deconvolution | Demodulation | DM642 | DSP Boards | DSP/BIOS | DTMF | Echo Cancellation | Equalization | Equalizer | ETSI | EZLITE (Ez-kit Lite) | FFT | FFTW | FIR Filter | Fixed Point | FSK | G.711 | G.723 | G.729 | Gaussian Noise | Goertzel | GPIO | Hilbert Transform | IFFT | IIR Filter | Interpolation | Invariance | JTAG | Kalman | Laplace Transform | Levinson | LPC | McBSP | MIPS | Modulation | MPEG | Multirate | Notch Filter | Nyquist | OFDM | Oversampling | Pink Noise | Pitch | PLL | Polyphase | QAM | QDMA | Quantization | Quantizer | Radar | Random Noise | Reed Solomon | Remez | Resampling | RTDX | Sampling | Sharc | TI C6711 | Undersampling | Viterbi | Wavelets | White Noise | Wiener Filter | Windowing | XDS510PP | Z Transform


Discussion Groups

Free Online Books

See Also

Embedded SystemsFPGAElectronics

Discussion Groups | Comp.DSP | FIR Filter


There are 23 messages in this thread.

You are currently looking at messages 0 to 10.


FIR Filter - phuture_project - 2004-06-30 03:47:00

Hi,

As i've got problems using FFT or Goertzel algorithm (for those who
are interested by the reason see my previous post called "some
goertzel questions"), i'll try to use a narrow bandpass filter. I
already made one some months ago. It was a FIR filter with a bandpass
300-1000 Hz and a sample frequency of 8000 Hz.

Now i'd like to design a narrower filter centered on 9 kHz with a
higher sample frequency, let's say between 100 kHz and 400 kHz, i
don't know for the moment.

For the filter i made some months ago i used the software
http://www.digitalfilter.com/jvfir/jvfir.html in order to get the
coefficients value. But now it doesn't work anymore, the requirements
seem to be too "big".
So is there anybody here who can give me a link to a FREE fir filter
design software which will stand these requirements and allow me to
get the coefficients value? I'll be very grateful!
If this FREE software doesn't exist, could someone tell me how i can
do it with Matlab? I think i'm able to design the filter (i believe i
tried some months ago) with Matlab but not to get the coefficients
value. What code lines must i write?

Thanks again for all the people who will help me. I do apreciate.
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: FIR Filter - Andre - 2004-06-30 04:29:00



Just a thought:

Low bandwidth FIR filters at high samp rates tend to get very long. If 
you want to have 500Hz of bandwidh at fs=400kHz, expect to need about 
800 coefficients (400/0.5)!

I used to design FIR filters in an iterative way using Matlab: Just 
randomly modify your coefficients, and accept a change if it gets you 
closer to what you want. You have to define an error function here. If 
you find no improvement anymore, lower the modification factor, if you 
do, increase it slightly. Let this run for some 1000 iterations. The 
filter is NOT linear phase, but has a better frequency response for a 
given FIR size.

best regards,

Andre



phuture_project wrote:

> Hi,
> 
> As i've got problems using FFT or Goertzel algorithm (for those who
> are interested by the reason see my previous post called "some
> goertzel questions"), i'll try to use a narrow bandpass filter. I
> already made one some months ago. It was a FIR filter with a bandpass
> 300-1000 Hz and a sample frequency of 8000 Hz.
> 
> Now i'd like to design a narrower filter centered on 9 kHz with a
> higher sample frequency, let's say between 100 kHz and 400 kHz, i
> don't know for the moment.
> 
> For the filter i made some months ago i used the software
> http://www.digitalfilter.com/jvfir/jvfir.html in order to get the
> coefficients value. But now it doesn't work anymore, the requirements
> seem to be too "big".
> So is there anybody here who can give me a link to a FREE fir filter
> design software which will stand these requirements and allow me to
> get the coefficients value? I'll be very grateful!
> If this FREE software doesn't exist, could someone tell me how i can
> do it with Matlab? I think i'm able to design the filter (i believe i
> tried some months ago) with Matlab but not to get the coefficients
> value. What code lines must i write?
> 
> Thanks again for all the people who will help me. I do apreciate.


-- 

Please change no_spam to a.lodwig when replying via email!
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: FIR Filter - Adrian - 2004-06-30 09:58:00

winfilter is a digital filter design freeware.

http://www.winfilter.20m.com

A new version will be avalaible very soon with 8/16-bit coefficient 
quantization and a possibility of vhdl code generation for fir.

Adrian

phuture_project wrote:
> Hi,
> 
> As i've got problems using FFT or Goertzel algorithm (for those who
> are interested by the reason see my previous post called "some
> goertzel questions"), i'll try to use a narrow bandpass filter. I
> already made one some months ago. It was a FIR filter with a bandpass
> 300-1000 Hz and a sample frequency of 8000 Hz.
> 
> Now i'd like to design a narrower filter centered on 9 kHz with a
> higher sample frequency, let's say between 100 kHz and 400 kHz, i
> don't know for the moment.
> 
> For the filter i made some months ago i used the software
> http://www.digitalfilter.com/jvfir/jvfir.html in order to get the
> coefficients value. But now it doesn't work anymore, the requirements
> seem to be too "big".
> So is there anybody here who can give me a link to a FREE fir filter
> design software which will stand these requirements and allow me to
> get the coefficients value? I'll be very grateful!
> If this FREE software doesn't exist, could someone tell me how i can
> do it with Matlab? I think i'm able to design the filter (i believe i
> tried some months ago) with Matlab but not to get the coefficients
> value. What code lines must i write?
> 
> Thanks again for all the people who will help me. I do apreciate.

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: FIR Filter - Suodatin Pussi - 2004-06-30 11:39:00

phuture_project wrote:
> Hi,
> 
> As i've got problems using FFT or Goertzel algorithm (for those who
> are interested by the reason see my previous post called "some
> goertzel questions"), i'll try to use a narrow bandpass filter. I
> already made one some months ago. It was a FIR filter with a bandpass
> 300-1000 Hz and a sample frequency of 8000 Hz.
> 
> Now i'd like to design a narrower filter centered on 9 kHz with a
> higher sample frequency, let's say between 100 kHz and 400 kHz, i
> don't know for the moment.
Hi,
I assume you don't have the signal processing toolbox, otherwise use the
function fir1 (or similar). Below some code I wrote

good luck

firsize=1024
fs=80000
fl=300
fh=1000

minfreqbins=3; % choose an appropriate value

binsize=fs/firsize;
if floor(fl/binsize) < minfreqbins ;
    % check if you've got enough resolution
    NUMBER_OF_BINS_TO_LOW_INCREASE_FIRSIZE_OR_LOWER_SAMPLERATE=1
end;

% clear transfer
h0=zeros(1,firsize/2);

% fill pass band with ones
h0([round(300/binsize)+1:1:round(1000/binsize)])=1;

% make fft spectrum
h=[h0(1:firsize/2) fliplr(conj(h0(1:firsize/2)))]';

% make fir, you could window the fir (you should!)
f=real(fftshift(ifft(h)));

% plot the fir
figure(1)
plot(f)

y=fft(f);

% plot amplitude
figure(2)
semilogx(binsize*[0:1:firsize/2-1],20*log10(abs(y(1:firsize/2))),'r');

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: FIR Filter - phuture_project - 2004-07-01 03:52:00

Hi Andre,

Thanks for your answer.

> Low bandwidth FIR filters at high samp rates tend to get very long. If 
> you want to have 500Hz of bandwidh at fs=400kHz, expect to need about 
> 800 coefficients (400/0.5)!


That's the way to know how many coefficients we have to use?
Indeed, it will be very long. That won't be acceptable! Isn't there
another way to do it or a way to decrease the execution time?


Thanks again.
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: FIR Filter - phuture_project - 2004-07-01 03:53:00

Hi Adrian,

Thanks for your answer.

> winfilter is a digital filter design freeware.
> 
> http://www.winfilter.20m.com
> 
> A new version will be avalaible very soon with 8/16-bit coefficient 
> quantization and a possibility of vhdl code generation for fir.
 
Thanks for the link. I'm sorry but i'm unable to donwload it, there is an error!
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: FIR Filter - phuture_project - 2004-07-01 03:57:00

Hi Suodatin,

Thanks for your answer.

> Hi,
> I assume you don't have the signal processing toolbox, otherwise use the
> function fir1 (or similar). Below some code I wrote

In fact i find a way to design the filter. I'm using Scilab. It seems
to work.
The only drawback is that the coefficients are real so i must
translate each one in Q15. It's very long! Is there an automatic way
(under excel?) or software that can allow to do it rapidly?

 
> good luck
> 
> firsize=1024
> fs=80000
> fl=300
> fh=1000
> 
> minfreqbins=3; % choose an appropriate value
> 
> binsize=fs/firsize;
> if floor(fl/binsize) < minfreqbins ;
>     % check if you've got enough resolution
>     NUMBER_OF_BINS_TO_LOW_INCREASE_FIRSIZE_OR_LOWER_SAMPLERATE=1
> end;
> 
> % clear transfer
> h0=zeros(1,firsize/2);
> 
> % fill pass band with ones
> h0([round(300/binsize)+1:1:round(1000/binsize)])=1;
> 
> % make fft spectrum
> h=[h0(1:firsize/2) fliplr(conj(h0(1:firsize/2)))]';
> 
> % make fir, you could window the fir (you should!)
> f=real(fftshift(ifft(h)));
> 
> % plot the fir
> figure(1)
> plot(f)
> 
> y=fft(f);
> 
> % plot amplitude
> figure(2)
> semilogx(binsize*[0:1:firsize/2-1],20*log10(abs(y(1:firsize/2))),'r');

Really thanks for this code. I'm sorry you spend time writing it and i
won't use it. I do apreciate your help.

Thanks again.
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: FIR Filter - Andre - 2004-07-01 07:35:00

If all coefficients are < 1, just multiply them with 32768!
Best regards,

Andre


phuture_project wrote:

> Hi Suodatin,
> 
> Thanks for your answer.
> 
> 
>>Hi,
>>I assume you don't have the signal processing toolbox, otherwise use the
>>function fir1 (or similar). Below some code I wrote
> 
> 
> In fact i find a way to design the filter. I'm using Scilab. It seems
> to work.
> The only drawback is that the coefficients are real so i must
> translate each one in Q15. It's very long! Is there an automatic way
> (under excel?) or software that can allow to do it rapidly?
> 
>  
> 
>>good luck
>>
>>firsize=1024
>>fs=80000
>>fl=300
>>fh=1000
>>
>>minfreqbins=3; % choose an appropriate value
>>
>>binsize=fs/firsize;
>>if floor(fl/binsize) < minfreqbins ;
>>    % check if you've got enough resolution
>>    NUMBER_OF_BINS_TO_LOW_INCREASE_FIRSIZE_OR_LOWER_SAMPLERATE=1
>>end;
>>
>>% clear transfer
>>h0=zeros(1,firsize/2);
>>
>>% fill pass band with ones
>>h0([round(300/binsize)+1:1:round(1000/binsize)])=1;
>>
>>% make fft spectrum
>>h=[h0(1:firsize/2) fliplr(conj(h0(1:firsize/2)))]';
>>
>>% make fir, you could window the fir (you should!)
>>f=real(fftshift(ifft(h)));
>>
>>% plot the fir
>>figure(1)
>>plot(f)
>>
>>y=fft(f);
>>
>>% plot amplitude
>>figure(2)
>>semilogx(binsize*[0:1:firsize/2-1],20*log10(abs(y(1:firsize/2))),'r');
> 
> 
> Really thanks for this code. I'm sorry you spend time writing it and i
> won't use it. I do apreciate your help.
> 
> Thanks again.


-- 

Please change no_spam to a.lodwig when replying via email!
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: FIR Filter - Jerry Avins - 2004-07-01 12:32:00

phuture_project wrote:
> Hi Suodatin,
> 
> Thanks for your answer.
> 
> 
>>Hi,
>>I assume you don't have the signal processing toolbox, otherwise use the
>>function fir1 (or similar). Below some code I wrote
> 
> 
> In fact i find a way to design the filter. I'm using Scilab. It seems
> to work.
> The only drawback is that the coefficients are real so i must
> translate each one in Q15. It's very long! Is there an automatic way
> (under excel?) or software that can allow to do it rapidly?
> 
   ...

Multiply by 32,768. Round to nearest integer. Discard fractional part.

+32,768 is not a permitted value. If it appears, either knock it down to
32,767, thereby creating a small error, or redo the whole set, using
32,767 instead of 32,768 as the multiplier.

Jerry
-- 
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: FIR Filter - Jerry Avins - 2004-07-01 12:40:00

phuture_project wrote:

> Hi Andre,
> 
> Thanks for your answer.
> 
> 
>>Low bandwidth FIR filters at high samp rates tend to get very long. If 
>>you want to have 500Hz of bandwidh at fs=400kHz, expect to need about 
>>800 coefficients (400/0.5)!
> 
> 
> 
> That's the way to know how many coefficients we have to use?
> Indeed, it will be very long. That won't be acceptable! Isn't there
> another way to do it or a way to decrease the execution time?
> 
> 
> Thanks again.

IIR. Goertzel. Not all that different.

Jerry
-- 
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

| 1 | 2 | 3 | next