DSPRelated.com
Forums

filtering before or after resampling?

Started by sujani August 19, 2004
Hi all,
I have two sets of data captured at frequencies of 100 Hz and 120
Hz.In order to comapre the sets of data,I need to resample them to the
same frequency.I also should filter the data.
I am wondering which order is the best-filtering followed by
resampling,or resampling followed by filtering?
Thanks for your commnets,
Sujani.
"sujani" <an_sujani@yahoo.com> wrote in message
news:c2de7df9.0408190800.601b438@posting.google.com...
> Hi all, > I have two sets of data captured at frequencies of 100 Hz and 120 > Hz.In order to comapre the sets of data,I need to resample them to the > same frequency.I also should filter the data. > I am wondering which order is the best-filtering followed by > resampling,or resampling followed by filtering? > Thanks for your commnets, > Sujani.
Hi Sujani Any resampling will probably involve some filtering (if you don't want to distort your signal with aliases). If you consider resampling to only involve dropping samples or adding zeros, then the filtering stage depends on which of the two (or both) operations you do. Your order should typically be interpolate (upsample) - filter - decimate (downsample). Cheers Bhaskar
"Bhaskar Thiagarajan" <bhaskart@my-deja.com> writes:

> "sujani" <an_sujani@yahoo.com> wrote in message > news:c2de7df9.0408190800.601b438@posting.google.com... > > Hi all, > > I have two sets of data captured at frequencies of 100 Hz and 120 > > Hz.In order to comapre the sets of data,I need to resample them to the > > same frequency.I also should filter the data. > > I am wondering which order is the best-filtering followed by > > resampling,or resampling followed by filtering? > > Thanks for your commnets, > > Sujani. > > Hi Sujani > > Any resampling will probably involve some filtering (if you don't want to > distort your signal with aliases). > If you consider resampling to only involve dropping samples or adding zeros, > then the filtering stage depends on which of the two (or both) operations > you do. > Your order should typically be interpolate (upsample) - filter - decimate > (downsample).
I also suggest you upsample the 100 Hz signal to 120 Hz. This loses no information. Resampling the 120 Hz signal from 120 Hz to 100 Hz may lose information in the 120 Hz signal. -- Randy Yates Sony Ericsson Mobile Communications Research Triangle Park, NC, USA randy.yates@sonyericsson.com, 919-472-1124
sujani wrote:
> > Hi all, > I have two sets of data captured at frequencies of 100 Hz and 120 > Hz.In order to comapre the sets of data,I need to resample them to the > same frequency.I also should filter the data. > I am wondering which order is the best-filtering followed by > resampling,or resampling followed by filtering?
If you are upsampling, you can filter before or after the upsampling it doesn't really matter. If you are downsampling, you must filter before. You may also want to have a look at this: http://www.mega-nerd.com/SRC/ Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo nospam@mega-nerd.com (Yes it's valid) +-----------------------------------------------------------+ "There is no reason why anyone would want a computer in their home" Ken Olson, DEC, 1977
Erik de Castro Lopo <nospam@mega-nerd.com> writes:
> [...] > If you are upsampling, you can filter before or after the > upsampling it doesn't really matter.
Erik, You didn't really mean this, did you? -- % Randy Yates % "The dreamer, the unwoken fool - %% Fuquay-Varina, NC % in dreams, no pain will kiss the brow..." %%% 919-577-9882 % %%%% <yates@ieee.org> % 'Eldorado Overture', *Eldorado*, ELO http://home.earthlink.net/~yatescr
Randy Yates wrote:
> > Erik de Castro Lopo <nospam@mega-nerd.com> writes: > > [...] > > If you are upsampling, you can filter before or after the > > upsampling it doesn't really matter. > > Erik, > > You didn't really mean this, did you?
Yeah, maybe I should try again. How's this: If you upsample by an integer factor using zero stuffing, then you can filter afterwards, otherwise you need to filter before. Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo nospam@mega-nerd.com (Yes it's valid) +-----------------------------------------------------------+ " Baldie is such a wonderful villain The Linux/OSS community could not possibly ask for a better villain than our man Baldie. He is absolutely perfect for the part. Just look at his creds: 1) Physically repulsive; 2) Morally bankrupt; 3) Megalomaniacal; 4) Possessed of a truly nasty, abusive disposition; 5) Prone to Hitlerian ranting; 6) Stalinesque paranoia... The list just goes on and on. The man has the gift of true despicability, no doubt about it. If it weren't for Baldie we'd be stuck with Bilgatus' merely vacuuous and creepy persona for an anthropomorphization of the Evil Empire -- tepid at best." -- Matthew Alton in LinuxToday.com on Steve Balmer
Hi all,
Thanks for all the suggestions.I think we will go with downsampling to
100 Hz,and filter before resampling.
Sujani.


Erik de Castro Lopo <nospam@mega-nerd.com> wrote in message news:<4125A0A7.A2FF7B0C@mega-nerd.com>...
> Randy Yates wrote: > > > > Erik de Castro Lopo <nospam@mega-nerd.com> writes: > > > [...] > > > If you are upsampling, you can filter before or after the > > > upsampling it doesn't really matter. > > > > Erik, > > > > You didn't really mean this, did you? > > Yeah, maybe I should try again. > > How's this: > > If you upsample by an integer factor using zero > stuffing, then you can filter afterwards, otherwise > you need to filter before. > > > Erik > -- > +-----------------------------------------------------------+ > Erik de Castro Lopo nospam@mega-nerd.com (Yes it's valid) > +-----------------------------------------------------------+ > " Baldie is such a wonderful villain > The Linux/OSS community could not possibly ask for a better villain than > our man Baldie. He is absolutely perfect for the part. Just look at his > creds: 1) Physically repulsive; 2) Morally bankrupt; 3) Megalomaniacal; > 4) Possessed of a truly nasty, abusive disposition; 5) Prone to Hitlerian > ranting; 6) Stalinesque paranoia... The list just goes on and on. The man > has the gift of true despicability, no doubt about it. If it weren't for > Baldie we'd be stuck with Bilgatus' merely vacuuous and creepy persona > for an anthropomorphization of the Evil Empire -- tepid at best." > -- Matthew Alton in LinuxToday.com on Steve Balmer
Hi all,
After some initial research about resampling,I finally understood
everyone's answers for my previous query....
This is what I have fugured out:
Since I have to downsample from 120 Hz to 100 Hz,my sampling factor
would be 1.2(6/5).So,I have to upsample by a factor of "6",and then
downsample by a factor of "5".
I found a program in "LabVIEW" that will do it for me.But I am not
sure I understand all facts about "alias rejection" and "normalized
bandwidth"?(Is this the same bandwidth used for the input signal?)
Hope I made some sense.
Thanks,
Sujani.


Erik de Castro Lopo <nospam@mega-nerd.com> wrote in message news:<4125A0A7.A2FF7B0C@mega-nerd.com>...
> Randy Yates wrote: > > > > Erik de Castro Lopo <nospam@mega-nerd.com> writes: > > > [...] > > > If you are upsampling, you can filter before or after the > > > upsampling it doesn't really matter. > > > > Erik, > > > > You didn't really mean this, did you? > > Yeah, maybe I should try again. > > How's this: > > If you upsample by an integer factor using zero > stuffing, then you can filter afterwards, otherwise > you need to filter before. > > > Erik > -- > +-----------------------------------------------------------+ > Erik de Castro Lopo nospam@mega-nerd.com (Yes it's valid) > +-----------------------------------------------------------+ > " Baldie is such a wonderful villain > The Linux/OSS community could not possibly ask for a better villain than > our man Baldie. He is absolutely perfect for the part. Just look at his > creds: 1) Physically repulsive; 2) Morally bankrupt; 3) Megalomaniacal; > 4) Possessed of a truly nasty, abusive disposition; 5) Prone to Hitlerian > ranting; 6) Stalinesque paranoia... The list just goes on and on. The man > has the gift of true despicability, no doubt about it. If it weren't for > Baldie we'd be stuck with Bilgatus' merely vacuuous and creepy persona > for an anthropomorphization of the Evil Empire -- tepid at best." > -- Matthew Alton in LinuxToday.com on Steve Balmer