DSPRelated.com
Forums

I have a sampled signal that was HP-filtered before sampling. Is there a way to revert the HP-filtering?

Started by Unknown January 17, 2017
I have a sampled signal that was HP-filtered before sampling.

Is there a way to revert the signal back to its pre-HP-filtered state?

I know it is impossible to restore the DC-component of the signal. But we can assume it is 0V.



I MATLAB script to show how the signal x looks HP-filtered:

%

% Butterworth Highpass filter designed using FDESIGN.HIGHPASS.

% All frequency values are in Hz.
Fs = 100000000;  % Sampling Frequency

N  = 2;         % Order
Fc = 500000;  % Cutoff Frequency

% Construct an FDESIGN object and call its BUTTER method.
h  = fdesign.highpass('N,Fc', N, Fc, Fs);
Hd = butter(h);

x = zeros(1, 50);
% Add pulse
x(10) = 1;
x(11) = 1;
x(12) = 1;
x(13) = 1;
x(14) = 1;

x_hp_filt = filter(Hd, x);

close all
figure
plot(x)
hold on
plot(x_hp_filt, 'r')


On Tue, 17 Jan 2017 04:56:20 -0800, karlskogasweden wrote:

> I have a sampled signal that was HP-filtered before sampling. > > Is there a way to revert the signal back to its pre-HP-filtered state? > > I know it is impossible to restore the DC-component of the signal. But > we can assume it is 0V. > > > > I MATLAB script to show how the signal x looks HP-filtered: > > % > > % Butterworth Highpass filter designed using FDESIGN.HIGHPASS. > > % All frequency values are in Hz. > Fs = 100000000; % Sampling Frequency > > N = 2; % Order Fc = 500000; % Cutoff Frequency > > % Construct an FDESIGN object and call its BUTTER method. > h = fdesign.highpass('N,Fc', N, Fc, Fs); > Hd = butter(h); > > x = zeros(1, 50); > % Add pulse x(10) = 1; > x(11) = 1; > x(12) = 1; > x(13) = 1; > x(14) = 1; > > x_hp_filt = filter(Hd, x); > > close all figure plot(x) > hold on plot(x_hp_filt, 'r')
Let me answer that question using my coffee filter analogy for signal filters: I have a cup of coffee that has the grounds filtered out. Can I put the grounds back in without digging the used filter out of the trash? To the extent that the high-pass filter actually removed the low- frequency data, no, you can't. Signal filters remove noise by proportional attenuation, meaning that in theory, except at a few discrete frequencies (such as 0Hz), the information is still in there. But there will also be noise, and as the attenuation gets higher, the resulting signal to noise ratio will get lower. In my experience, doing what you're trying to do is a desperate measure. Maybe you can do it with the appropriate emphasis filter, but in general such dodges rarely work satisfactorily. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com I'm looking for work -- see my website!
On Tue, 17 Jan 2017 12:07:08 -0600, Tim Wescott
<seemywebsite@myfooter.really> wrote:

>On Tue, 17 Jan 2017 04:56:20 -0800, karlskogasweden wrote: > >> I have a sampled signal that was HP-filtered before sampling. >> >> Is there a way to revert the signal back to its pre-HP-filtered state? >> >> I know it is impossible to restore the DC-component of the signal. But >> we can assume it is 0V. >> >> >> >> I MATLAB script to show how the signal x looks HP-filtered: >> >> % >> >> % Butterworth Highpass filter designed using FDESIGN.HIGHPASS. >> >> % All frequency values are in Hz. >> Fs = 100000000; % Sampling Frequency >> >> N = 2; % Order Fc = 500000; % Cutoff Frequency >> >> % Construct an FDESIGN object and call its BUTTER method. >> h = fdesign.highpass('N,Fc', N, Fc, Fs); >> Hd = butter(h); >> >> x = zeros(1, 50); >> % Add pulse x(10) = 1; >> x(11) = 1; >> x(12) = 1; >> x(13) = 1; >> x(14) = 1; >> >> x_hp_filt = filter(Hd, x); >> >> close all figure plot(x) >> hold on plot(x_hp_filt, 'r') > >Let me answer that question using my coffee filter analogy for signal >filters: I have a cup of coffee that has the grounds filtered out. Can I >put the grounds back in without digging the used filter out of the trash? > >To the extent that the high-pass filter actually removed the low- >frequency data, no, you can't. Signal filters remove noise by >proportional attenuation, meaning that in theory, except at a few >discrete frequencies (such as 0Hz), the information is still in there. >But there will also be noise, and as the attenuation gets higher, the >resulting signal to noise ratio will get lower. > >In my experience, doing what you're trying to do is a desperate measure. >Maybe you can do it with the appropriate emphasis filter, but in general >such dodges rarely work satisfactorily.
I like the coffe filter analogy ! If the larger coffee grounds are a lower frequency, then, depending on what the order of HP filtering was, he might be able to retrieve some of the smaller coffee grounds. boB K7IQ
On Tue, 17 Jan 2017 11:55:27 -0800, boB wrote:

> On Tue, 17 Jan 2017 12:07:08 -0600, Tim Wescott > <seemywebsite@myfooter.really> wrote: > >>On Tue, 17 Jan 2017 04:56:20 -0800, karlskogasweden wrote: >> >>> I have a sampled signal that was HP-filtered before sampling. >>> >>> Is there a way to revert the signal back to its pre-HP-filtered state? >>> >>> I know it is impossible to restore the DC-component of the signal. But >>> we can assume it is 0V. >>> >>> >>> >>> I MATLAB script to show how the signal x looks HP-filtered: >>> >>> % >>> >>> % Butterworth Highpass filter designed using FDESIGN.HIGHPASS. >>> >>> % All frequency values are in Hz. >>> Fs = 100000000; % Sampling Frequency >>> >>> N = 2; % Order Fc = 500000; % Cutoff Frequency >>> >>> % Construct an FDESIGN object and call its BUTTER method. >>> h = fdesign.highpass('N,Fc', N, Fc, Fs); >>> Hd = butter(h); >>> >>> x = zeros(1, 50); >>> % Add pulse x(10) = 1; >>> x(11) = 1; >>> x(12) = 1; >>> x(13) = 1; >>> x(14) = 1; >>> >>> x_hp_filt = filter(Hd, x); >>> >>> close all figure plot(x) >>> hold on plot(x_hp_filt, 'r') >> >>Let me answer that question using my coffee filter analogy for signal >>filters: I have a cup of coffee that has the grounds filtered out. Can >>I put the grounds back in without digging the used filter out of the >>trash? >> >>To the extent that the high-pass filter actually removed the low- >>frequency data, no, you can't. Signal filters remove noise by >>proportional attenuation, meaning that in theory, except at a few >>discrete frequencies (such as 0Hz), the information is still in there. >>But there will also be noise, and as the attenuation gets higher, the >>resulting signal to noise ratio will get lower. >> >>In my experience, doing what you're trying to do is a desperate measure. >>Maybe you can do it with the appropriate emphasis filter, but in general >>such dodges rarely work satisfactorily. > > I like the coffe filter analogy ! > > If the larger coffee grounds are a lower frequency, then, depending on > what the order of HP filtering was, he might be able to retrieve some of > the smaller coffee grounds. > > boB K7IQ
I haven't used it for a while -- I invented it in the middle of a spate of questions that basically boiled down to "I want to do something magic, what filter do I use?" Explaining that "filter" in the signals sense meant the same as "filter" in the coffee sense helps folks who think that signal processing is magic to get a more visceral sense of what it's really all about. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com I'm looking for work -- see my website!
On Tue, 17 Jan 2017 04:56:20 -0800 (PST), karlskogasweden@gmail.com
wrote:

>I have a sampled signal that was HP-filtered before sampling. > >Is there a way to revert the signal back to its pre-HP-filtered state? > >I know it is impossible to restore the DC-component of the signal. But we can assume it is 0V. > > > >I MATLAB script to show how the signal x looks HP-filtered: > >% > >% Butterworth Highpass filter designed using FDESIGN.HIGHPASS. > >% All frequency values are in Hz. >Fs = 100000000; % Sampling Frequency > >N = 2; % Order >Fc = 500000; % Cutoff Frequency > >% Construct an FDESIGN object and call its BUTTER method. >h = fdesign.highpass('N,Fc', N, Fc, Fs); >Hd = butter(h); > >x = zeros(1, 50); >% Add pulse >x(10) = 1; >x(11) = 1; >x(12) = 1; >x(13) = 1; >x(14) = 1; > >x_hp_filt = filter(Hd, x); > >close all >figure >plot(x) >hold on >plot(x_hp_filt, 'r') > >
Another thought similar to what Tim posted: A frequency-selective filter removes information. Generally once that information is discarded (by the filter), it is no longer in the signal and can't be restored from the information left in the signal after the filter. Someone takes a phone book and removes the sections for all names starting with A, B, and C. Can the information in those sections be restored from the remaining portions of the phone book? Generally not. This assumes that people remember what phone books were. I was teaching at a teen driving school a couple weekends ago and there was a braking exercise with a big plastic poster of a moose on a spring-loaded mount that the students needed to avoid. Several of the instructors and I were referring to the moose as "Bullwinkle". As in, "Don't hit Bullwinkle." Through the weekend we had roughly 300 students come through and I think two knew who Bullwinkle was. That made us feel old. Then we figured out that about half the instructors didn't know who Bullwinkle was and we felt even older. So, maybe a phone book example is not contemporary enough. --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
On 1/17/2017 5:35 PM, eric.jacobsen@ieee.org wrote:
> On Tue, 17 Jan 2017 04:56:20 -0800 (PST), karlskogasweden@gmail.com > wrote: > >> I have a sampled signal that was HP-filtered before sampling. >> >> Is there a way to revert the signal back to its pre-HP-filtered state? >> >> I know it is impossible to restore the DC-component of the signal. But we can assume it is 0V. >> >> >> >> I MATLAB script to show how the signal x looks HP-filtered: >> >> % >> >> % Butterworth Highpass filter designed using FDESIGN.HIGHPASS. >> >> % All frequency values are in Hz. >> Fs = 100000000; % Sampling Frequency >> >> N = 2; % Order >> Fc = 500000; % Cutoff Frequency >> >> % Construct an FDESIGN object and call its BUTTER method. >> h = fdesign.highpass('N,Fc', N, Fc, Fs); >> Hd = butter(h); >> >> x = zeros(1, 50); >> % Add pulse >> x(10) = 1; >> x(11) = 1; >> x(12) = 1; >> x(13) = 1; >> x(14) = 1; >> >> x_hp_filt = filter(Hd, x); >> >> close all >> figure >> plot(x) >> hold on >> plot(x_hp_filt, 'r') >> >> > > Another thought similar to what Tim posted: > > A frequency-selective filter removes information. Generally once > that information is discarded (by the filter), it is no longer in the > signal and can't be restored from the information left in the signal > after the filter. > > Someone takes a phone book and removes the sections for all names > starting with A, B, and C. Can the information in those sections be > restored from the remaining portions of the phone book? > > Generally not. > > This assumes that people remember what phone books were. > > I was teaching at a teen driving school a couple weekends ago and > there was a braking exercise with a big plastic poster of a moose on a > spring-loaded mount that the students needed to avoid. Several of > the instructors and I were referring to the moose as "Bullwinkle". As > in, "Don't hit Bullwinkle." Through the weekend we had roughly 300 > students come through and I think two knew who Bullwinkle was. That > made us feel old. Then we figured out that about half the > instructors didn't know who Bullwinkle was and we felt even older. > > So, maybe a phone book example is not contemporary enough.
It won't be long before using any "book" won't be contemporary enough. -- Rick C
On Wednesday, January 18, 2017 at 6:35:49 AM UTC+8, eric.j...@ieee.org wrote:
> > A frequency-selective filter removes information. Generally once > that information is discarded (by the filter), it is no longer in the > signal and can't be restored from the information left in the signal > after the filter. >
It depends: in my field, data is recorded at 24 bits, and inverse filters are used. If it was Butterworth filter, the information is squashed but not eliminated. But if an Ormsby filter were used, then you are up shit creek.
On Wed, 18 Jan 2017 03:19:27 -0800 (PST), pedro1492@lycos.com wrote:

>On Wednesday, January 18, 2017 at 6:35:49 AM UTC+8, eric.j...@ieee.org wrote: >> >> A frequency-selective filter removes information. Generally once >> that information is discarded (by the filter), it is no longer in the >> signal and can't be restored from the information left in the signal >> after the filter. >> > >It depends: in my field, data is recorded at 24 bits, and inverse filters >are used. If it was Butterworth filter, the information is squashed but not >eliminated. But if an Ormsby filter were used, then you are up shit creek.
Information is still lost because of the reduction in SNR of the attenuated frequencies. Once it's gone, you ain't getting it back. You may get the little bit that's not quite gone, but you won't get what's gone. It's essentially the same as an equalizer restoring a null from a transmission channel. You do get something back, but it comes at the cost of the reduction in SNR (which is information loss). The point of the equalizer is to amplify what information is left so that you can use it (for a net gain over what you had before the EQ), but it can't restore what's gone. --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
On Wed, 18 Jan 2017 03:19:27 -0800, pedro1492 wrote:

> On Wednesday, January 18, 2017 at 6:35:49 AM UTC+8, eric.j...@ieee.org > wrote: >> >> A frequency-selective filter removes information. Generally once that >> information is discarded (by the filter), it is no longer in the signal >> and can't be restored from the information left in the signal after the >> filter. >> >> > It depends: in my field, data is recorded at 24 bits, and inverse > filters are used. If it was Butterworth filter, the information is > squashed but not eliminated. But if an Ormsby filter were used, then > you are up shit creek.
The issue can get cloudy if the noise is attenuated along with the desired signal. I'm working on what appears to be just such a system myself -- I'll find out in a few months to what extent I'm right. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com I'm looking for work -- see my website!
On 1/18/2017 12:36, Tim Wescott wrote:
> On Wed, 18 Jan 2017 03:19:27 -0800, pedro1492 wrote: > >> On Wednesday, January 18, 2017 at 6:35:49 AM UTC+8, eric.j...@ieee.org >> wrote: >>> >>> A frequency-selective filter removes information. Generally once that >>> information is discarded (by the filter), it is no longer in the signal >>> and can't be restored from the information left in the signal after the >>> filter. >>> >>> >> It depends: in my field, data is recorded at 24 bits, and inverse >> filters are used. If it was Butterworth filter, the information is >> squashed but not eliminated. But if an Ormsby filter were used, then >> you are up shit creek. > > The issue can get cloudy if the noise is attenuated along with the > desired signal. I'm working on what appears to be just such a system > myself -- I'll find out in a few months to what extent I'm right. >
Well, the problem is that it is a digital signal and is therefore quantized. Reducing the signal level at a given frequency must make the S/N ratio worse. -- Best wishes, --Phil pomartel At Comcast(ignore_this) dot net