Author Topic: how should I choose the cut of frequency of a filter?  (Read 498 times)

0 Members and 1 Guest are viewing this topic.

Offline xzswq21

  • Regular Contributor
  • *
  • Posts: 140
  • Country: 00
how should I choose the cut of frequency of a filter?
« on: December 07, 2018, 06:20:47 am »
Hello guys
I use a 100MHz high speed ADC. in theory I should use Low pass filter with f3dB=50Mhz as a Anti Aliasing Filter.
but I found a filter from mini-circuit with f1dB=40MHz and f3dB=56MHz. can I use it?
https://www.minicircuits.com/pdfs/RLP-40+.pdf

I have been working on instrumentation and industrial measurement arena (some times medical) such as analyzer.
which one of the below filter is better for me? (I don't work with narrow band)
SXLP-40+
SXLP-44+
SCLF-44+
RLP-40+

Best Regards
Thanks
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 11875
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: how should I choose the cut of frequency of a filter?
« Reply #1 on: December 07, 2018, 08:18:15 am »
What are you measuring, what is your actual signal?  Its bandwidth?

What's wrong with aliasing higher frequencies -- is there any consequence?  Is it just noise, is it correlated with the signal (e.g. harmonics), is it spurious and undesirable?

How sharp is the filter?

Do you need phase-flatness (good step response, typical for time-domain applications) or frequency-sharpness (typical for RF and audio applications)?

How much quantization noise / accuracy / resolution do you need?  Distortion?

In the below section, I've assumed you know what aliasing and frequency mixing effects are; if not, please read up on them.  They are instrumental to the precise application of ADCs. :-+

After you've answered all of these questions, you can design the filter's cutoff and slope, relative to the sample rate.  The signal chain shall have an analog (antialias) filter, the ADC, then a digital filter.  The goal is to have "100%" cutoff, at the frequency somewhat above Fs/2, which corresponds to the first aliased image of the cutoff frequency somewhat below Fs/2, that the digital signal path finally has.  By "100%" cutoff, I mean, any external signal or noise is reduced to below the noise floor, which is in turn defined by analog noise or ADC quantization noise, whichever is greater (actually, the sum of both).

For example, a time-domain application, like an oscilloscope, might use an 80MSps ADC, with 20MHz (-3dB) analog bandwidth, and (1-2-2-1 weighted) FIR digital filter for similar digital bandwidth, with a Bessel filter type giving -60dB (for an 8-bit ADC) at 80 - 20 = 60MHz.  Going from -3dB at 20MHz to -60dB at 60MHz requires about -120dB/dec or a 6th order filter.

Note that, for a radio application, the sample rate and analog filtering may be chosen to coincide with an RF passband, using aliasing to your advantage.  In that case, the band "skirts" need to be sharp enough to prevent further aliasing.  This is also known as Equivalent Time Sampling (ETS), and can be used in multiple (i.e., harmonic) bands simultaneously, which is how ETS oscilloscopes work: they're actually sampling many frequency bands, simultaneously and coherently, which correspond to the harmonics of the signal being measured.  Hence, the (periodic) waveform can be reconstructed, without violating Nyquist, because we've made an assumption about the signal (its periodicity).

Tim
Seven Transistor Labs, LLC
Electronic Design, from Concept to Layout.
Need engineering assistance? Drop me a message!
 
The following users thanked this post: xzswq21

Offline xzswq21

  • Regular Contributor
  • *
  • Posts: 140
  • Country: 00
Re: how should I choose the cut of frequency of a filter?
« Reply #2 on: December 07, 2018, 08:37:43 am »
Thanks for your attentions and reply
Actually I'm working on an impedance analyzer. the sampling frequency is 100MHz and I use Sine or MultiSine signals to excite a DUT.
in my system I can generate a signal within 50MHz that's whay I wanted to use a AAF at the input sampling portion.
I think a sharp rejection is better for me.
later I think I can filter the signal by a digital filter. the system is 14Bit. but the ENOB is around 10 to 12 Bits. (I will limit the bandwidth)
Thanks
 

Offline rhb

  • Super Contributor
  • ***
  • Posts: 1881
  • Country: us
Re: how should I choose the cut of frequency of a filter?
« Reply #3 on: December 07, 2018, 02:20:58 pm »
How many bits is your ADC?   At a minimum you want the filter to be # of bits x -3dB/octave  at Nyquist.  That way at Fc  and below there will be no aliasing.  However, you will have aliasing above Fc. So a digital filter is needed to clean that up.

Ideally you have Fc an octave below Nyquist and 1 pole per bit.  That's really hard to do at 16-24 bits, so oversampling and then applying a digital LP filter is common.

My DSP backgrounds is reflection seismology in the oil industry.  I've been shocked at how lax a lot of EEs are about anti-alias filters.  But if you are paying a company several million dollars to collect data, you are very particular about the details,  And "my system is calibrated to xyz" is not acceptable.  Everything gets tested by the client before shooting starts.  The impulse response of the amplifiers and filters.  The impulse response of the sources.  The acquisition contracts have strict requirements about sea state, number of misfunctioning sources and receivers which are allowed.  And there is a company representative on hand who is continually checking everything.  In marine work an array of air guns is used which has been carefully designed and tested.  If certain guns stop  working the acquisition company is obliged to stop operations and fix them before proceeding.
 
The following users thanked this post: xzswq21

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 11875
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: how should I choose the cut of frequency of a filter?
« Reply #4 on: December 07, 2018, 11:04:46 pm »
How many bits is your ADC?   At a minimum you want the filter to be # of bits x -3dB/octave  at Nyquist.  That way at Fc  and below there will be no aliasing.  However, you will have aliasing above Fc. So a digital filter is needed to clean that up.

That's the first rough guess, but it's not the minimum -- because aliased frequencies fold over, you don't need to meet the filtering threshold until Fs - Fc, where the offending signals can no longer be filtered apart from the intended signal.

In other words, you can allow frequencies to pass near Fs/2, both above and below, as long as both are ultimately filtered out digitally.  They will be attenuated (Fc always < Fs/2), but not to the noise floor, at the ADC output.

So the filter needs to start rolling off at Fc, and meet the stopband requirement by Fs - Fc.

This is pretty dramatic in the example I gave (20MHz 6 pole Bessel filter adequate for 8 bits at 80MSps).  It gets less useful, the sharper the filter is (the closer Fc is to Fs/2).  Still, anything that can save you from excessively high order filters, or sample rates, is nice.

It's also convenient to choose a hybrid pole-zero filter; not an all-zero (Elliptical or such), because of the poor stopband attenuation -- but a normal LPF with a few zeroes added at strategic places (e.g., near Fs/2 and 3Fs/2), and more poles than zeroes so the asymptotic attenuation remains good.  For example, you might start with a Cheb. 5 pole LPF, bypass two inductors with capacitors to introduce the zeroes (notches), and tweak values until the response is correct again.

Tim
Seven Transistor Labs, LLC
Electronic Design, from Concept to Layout.
Need engineering assistance? Drop me a message!
 

Offline rhb

  • Super Contributor
  • ***
  • Posts: 1881
  • Country: us
Re: how should I choose the cut of frequency of a filter?
« Reply #5 on: December 08, 2018, 01:45:45 am »
How many bits is your ADC?   At a minimum you want the filter to be # of bits x -3dB/octave  at Nyquist.  That way at Fc  and below there will be no aliasing.  However, you will have aliasing above Fc. So a digital filter is needed to clean that up.

That's the first rough guess, but it's not the minimum -- because aliased frequencies fold over, you don't need to meet the filtering threshold until Fs - Fc, where the offending signals can no longer be filtered apart from the intended signal.


That's actually exactly what I said.  In my calculation I folded the spectrum at Fn whereas you did not. And I divided the 6 dB per octave of a pole by two. Fs-Fc and Fc are symmetric about Fn which is Fs/2.

So we agree completely and have said the same thing.   Just different ways of saying it.

FWIW Every seismic processing operation I've been around (6)  has required several months to learn the local jargon.  If there are lots of people with a PhD in EE it will have a different flavor than if they have PhDs in geophysics.

And in seismic  we don't do real time filters, we just specify what we want it to look like in the time or frequency domain.  Typically the first thing is to make the impulse zero phase.  So we leave the analog filters to the EEs who build the equipment.  As long as it meets spec  we're happy.

My PhD supervisor was a member of Norbert Wiener's Geophysical Analysis Group at MIT.  So I was trained in that dialect.  Before that I worked for Amoco which employed Sven Treitel also a GAG alumnus, who with Enders Robinson, another  member of GAG, wrote all the major papers on the application of  prediction error filters and basic DSP to seismic data.  So I was taught very much in the GAG tradition.

Enders Robinson was the first person to actually perform DSP beyond simply calculating the discrete Fourier transform.

From the SEG wiki:

In September of 1950, as a young graduate student at MIT, Enders Robinson commenced the task which would revolutionize seismics. It must have seemed very humdrum at the time; it was the digitization, with a ruler and pencil, of eight seismic records from Texas. By the spring of 1951 there were autocorrelations and spectra. No surprises there it was deconvolution which was the great unknown...Would it work on real data? It took the whole summer of 1951 to deconvolve 32 traces. The first trace (plotted, of course, by hand) looked too good to be true. But then the second, and the third...
 
The following users thanked this post: xzswq21

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 11875
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: how should I choose the cut of frequency of a filter?
« Reply #6 on: December 08, 2018, 02:51:36 am »
How many bits is your ADC?   At a minimum you want the filter to be # of bits x -3dB/octave  at Nyquist.  That way at Fc  and below there will be no aliasing.  However, you will have aliasing above Fc. So a digital filter is needed to clean that up.

That's the first rough guess, but it's not the minimum -- because aliased frequencies fold over, you don't need to meet the filtering threshold until Fs - Fc, where the offending signals can no longer be filtered apart from the intended signal.


That's actually exactly what I said.  In my calculation I folded the spectrum at Fn whereas you did not. And I divided the 6 dB per octave of a pole by two. Fs-Fc and Fc are symmetric about Fn which is Fs/2.

So we agree completely and have said the same thing.   Just different ways of saying it.

Ahhh, I thought that 3dB looked a bit suspicious -- cheers. :)


Quote
In September of 1950, as a young graduate student at MIT, Enders Robinson commenced the task which would revolutionize seismics. It must have seemed very humdrum at the time; it was the digitization, with a ruler and pencil, of eight seismic records from Texas. By the spring of 1951 there were autocorrelations and spectra. No surprises there it was deconvolution which was the great unknown...Would it work on real data? It took the whole summer of 1951 to deconvolve 32 traces. The first trace (plotted, of course, by hand) looked too good to be true. But then the second, and the third...

Yikes; would've hoped they'd use an analog computer or analytical engine or something like that on it!  Maybe they didn't have the budget/access that the upper physicists did... :P

Tim
Seven Transistor Labs, LLC
Electronic Design, from Concept to Layout.
Need engineering assistance? Drop me a message!
 
The following users thanked this post: xzswq21

Offline xzswq21

  • Regular Contributor
  • *
  • Posts: 140
  • Country: 00
Re: how should I choose the cut of frequency of a filter?
« Reply #7 on: December 08, 2018, 06:38:30 am »
I found SXLP-36+ with F-1dB=36MHz and F-3dB=40MHz and:
https://www.minicircuits.com/pdfs/SXLP-36+.pdf
as per your replies I should attenuate the signal @Fc with 12Bit x (-10dB/dec)=-120 dB/dec
so I should use a digital FIR filter to attenuate the signal more.
Actually I have built the below filter with Fc=50MHz:
https://www.eevblog.com/forum/rf-microwave/help-me-to-improve-the-filter-response/
I think the response is acceptable.
if I used Elliptical filter bcoz the VSWR of linear phase filter in passband is usually very bad. (for example you can check SXLP-40+ with f-3dB=50MHz and you see the filter is Elliptical or Chebyshev2, I think)
« Last Edit: December 08, 2018, 07:21:29 am by xzswq21 »
Thanks
 

Offline rhb

  • Super Contributor
  • ***
  • Posts: 1881
  • Country: us
Re: how should I choose the cut of frequency of a filter?
« Reply #8 on: December 08, 2018, 10:25:41 am »

Yikes; would've hoped they'd use an analog computer or analytical engine or something like that on it!  Maybe they didn't have the budget/access that the upper physicists did... :P

Tim

Budget was not the issue.  Technology was the big obstacle. Until the mid 50's seismic was recorded on photographic  paper using mirror galvanometers..  The senior person on a seismic crew was called the computer.  It was not until the introduction  in mid 60's of analog tape that that changed and the senior person was called the observer which is still the case today.  The last analog recorders used 2" wide tape holding 21 tracks.   Texas Instruments was formed as a small subsidiary of Geophysical Services Incorporated where Milo was later head of research.  TI was organized to build seismic recording equipment for GSI.  As soon as TI could build ADCs which were able to collect 16-24 channels at 250 samples per second everything went digital and was recorded on the newly invented 9 track recorders at 800 bpi.


A bit more history.  Around 1939 or 40, the War Department asked Weiner to investigate where they should point an antiaircraft gun so the shells arrived where the plane was going to be when the shells got there.  The resulting report was widely known as the "yellow peril" because of the difficulty of the mathematics.  It was later published in 1949 as "Extrapolation, Interpolation and Smoothing of Stationary Time Series".  My copy is from the 2nd printing in 1950.

My PhD supervisor's (Milo Backus) sole significant work was to implement a prediction error filter using an analog magnetic drum around 1959.  This was to suppress ringing of the seismic impulse, dynamite in those days, in shallow water in the Middle East where the water bottom was very hard.

This was the origin of digital signal processing.  In 1951 there were no digital recorders, just one or two working computers in the whole world and only a handful even under construction or contemplated. And ENIAC, EDSAC were more like room size calculators than what we would describe as computers.  ENIAC's primary application was computing ballistic tables for artillery.  That was close to the limit of what it could do.

I don't know the history of GAG very well, but I would presume that funding came from the  oil industry. 
You can get a slight flavor of the history from this:

gsinet.us/Grapevine/Grapevine_Vol36No2_1980.pdf
 
The following users thanked this post: T3sl4co1l, RoGeorge, xzswq21

Offline xzswq21

  • Regular Contributor
  • *
  • Posts: 140
  • Country: 00
Re: how should I choose the cut of frequency of a filter?
« Reply #9 on: December 08, 2018, 07:10:29 pm »
if I use a 40MHz or 50MHz low pass filter can I use a digital IIR filter with the below spec??:
order: 20
stopband atten: 110dB



but I set the sample rate: 1GHz
but my real sample rate is 100MHz

today I want to buy some filters. if my 50MHz LPF is adequate and I can use a IIR filter like above I think it's not necessary to buy some new filters. what do u think?
« Last Edit: December 08, 2018, 09:49:00 pm by xzswq21 »
Thanks
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 11875
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: how should I choose the cut of frequency of a filter?
« Reply #10 on: December 08, 2018, 11:05:26 pm »
Exactly, at 100MSps you don't have much headroom to craft a sharp digital filter either.

Since you're generating your own signal and presumably fairly free of outside noise, the only offender is whatever harmonics and sidebands are generated by your own DAC.  And, is that really bad?  Who knows.

Well, you wouldn't want aliases being sampled incoherently.  Consider: if you set the DAC output on rising clock edges, and sample the ADC on falling edges, and the DAC to ADC path is perfectly flat, then there is no aliasing, it's perfectly fine.  (A real working example of this: feed an LCD monitor with analog VGA, and adjust the clock timing via on-screen display.  Over some critical window -- the DAC risetime plus the sampling aperture -- the transition between pixel colors gets blurred and noisy.  Sampling has to be coherent to give the correct results.)

Now suppose there is high frequency ringing, say, due to the presence of a network between the DAC and ADC which isn't flat at high frequencies.  Now the sampled value depends on when, during the clock cycle, the ADC samples its input.  In general, the correct sampling time may not be opposite the DAC clock, or anywhere else inbetween really -- the problem is, the base band and aliased bands can be delayed differently, so that the two no longer line up.

If we introduce an AA filter, the aliased bands go away.  We still don't know quite when to sample -- but we are guaranteed that, when we do, we will only be off by a small difference, because the input is changing gradually. 

Note that it doesn't matter where the AA filter is introduced: before or after the filter network, on the DAC or ADC side respectively.  We could even split it arbitrarily (two poles here, four poles there..).  The frequency response of the system (DDS output to ADC output), as long as it is linear, is the product of all transfer functions in the chain.  The product operator is commutative, so any given filter element can be placed anywhere.

Obviously, we cannot place a digital filter in the analog path*, so the fact that we have different data types, does force some constraints on the system.  But that's perfectly fine.

*Heh, well, we could, but we'd need to use a rather specialized switched-capacitor filter, not so easy to do at these frequencies.  It is a practical method at lower frequencies though.

So, the key here is you're measuring your own local signal, probably from the same clock no less, versus an unknown external signal.

Tim
Seven Transistor Labs, LLC
Electronic Design, from Concept to Layout.
Need engineering assistance? Drop me a message!
 

Offline xzswq21

  • Regular Contributor
  • *
  • Posts: 140
  • Country: 00
Re: how should I choose the cut of frequency of a filter?
« Reply #11 on: December 09, 2018, 07:54:21 am »
sample rate is 100MHz and I think I don't have any chance to use high order FIR or IIR digital filters.
now I think LPF-B35+ is a good choice for me.
https://ww2.minicircuits.com/pdfs/LPF-B35+.pdf
actually the noise floor in my system is about 100dBc and on the other hand the linearity is good. so I think the attenuation of above filter is adequate. what do u think?

(RLP-40+ is another candidate) but I'm not sure about it.???
https://www.minicircuits.com/pdfs/RLP-40+.pdf
« Last Edit: December 09, 2018, 08:29:48 am by xzswq21 »
Thanks
 

Offline rhb

  • Super Contributor
  • ***
  • Posts: 1881
  • Country: us
Re: how should I choose the cut of frequency of a filter?
« Reply #12 on: December 09, 2018, 08:36:47 am »
How many bits is your ADC?  That should work for 12-13 bits, but you'll still need an additional low pass digital filter with a 30-35 MHz Fc.  Otherwise everything from 35 to 50 MHZ will be corrupted by noise from 50 to 65 MHz.

It would help to know the desired BW and resolution.
 
The following users thanked this post: xzswq21

Offline xzswq21

  • Regular Contributor
  • *
  • Posts: 140
  • Country: 00
Re: how should I choose the cut of frequency of a filter?
« Reply #13 on: December 09, 2018, 08:46:32 am »
ADC is 14 Bit, 100MHz
the desired BW should be from 100KHz to (20MHz~40MHz)
these days I have been working on my thesis and I really need your suggestion.
but which one is better? or which upper band is more reliable? 30MHz or 35MHz...? . I can not find an ideal filter! I found LPF-B and RLP and SLP and SXLP series.
on the other hand the sample rate is 100Mhz and I Think I don't have any chance to use high order digital filters.
« Last Edit: December 09, 2018, 09:37:34 am by xzswq21 »
Thanks
 

Offline rhb

  • Super Contributor
  • ***
  • Posts: 1881
  • Country: us
Re: how should I choose the cut of frequency of a filter?
« Reply #14 on: December 09, 2018, 09:37:25 am »
If you're not going to apply a digital filter you need to be 84 dB down at 50 MHz.    What is the application?

Also why no digital filter?  A fairly low order filter should work and that's not a lot of compute for things like the STM32F4XX.  An ARM with the NEON FPU should scream at that.

If you're going to record data for later processing then you can do the filtering post acquisition. That is super easy.  Do an FFT, throw away the aliased frequencies and back transform to a lower sample rate.
 
The following users thanked this post: xzswq21

Offline xzswq21

  • Regular Contributor
  • *
  • Posts: 140
  • Country: 00
Re: how should I choose the cut of frequency of a filter?
« Reply #15 on: December 09, 2018, 09:47:53 am »
I want to sample some signals and I will send it to my laptop to process further more with MATLAB. (impedance analyzer) I'm working with FPGA and Cortex-A9.
but my sample rate is 100MHz.
for example the below is the response of a FIR filter with 20 taps and f-3dB=40MHz:

how many taps should I use? the filter is linear phase. can I use IIR filter?

you told me if you want a 12Bit resolution you need 12x(-10dB/dec) attenuation. OK? so I need -120 attenuation at 50MHz?

« Last Edit: December 09, 2018, 10:02:21 am by xzswq21 »
Thanks
 

Offline rhb

  • Super Contributor
  • ***
  • Posts: 1881
  • Country: us
Re: how should I choose the cut of frequency of a filter?
« Reply #16 on: December 09, 2018, 09:56:40 am »
I have no experience with real time DSP though I have a project to develop FOSS DSO FW for Zynq an Cyclone V based FPGAs.  So I will be learning that.  But at the moment I must plead almost complete ignorance.  I'd have to hit the books for several days to give a decent answer.

I've been working on the electrical power supply for my test bench all day.  It's almost done, I hope!  Then I can put all the test gear in my dining room back.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf