Sign in

Not a member? | Forgot your Password?

Search compdsp

Search tips

Find us on Facebook!





Free PDF Downloads

A Quadrature Signals Tutorial: Complex, But Not Complicated

Understanding the 'Phasing Method' of Single Sideband Demodulation

Complex Digital Signal Processing in Telecommunications

Introduction to Sound Processing

C++ Tutorial

Introduction of C Programming for DSP Applications

Fixed-Point Arithmetic: An Introduction

Cascaded Integrator-Comb (CIC) Filter Introduction

Discussion Groups

IIR Filter Design Software

Free Online Books

See Also

Embedded SystemsFPGA

Discussion Groups | Comp.DSP | frequency respons of halfband filter?

There are 24 messages in this thread.

You are currently looking at messages 1 to .


Is this discussion worth a thumbs up?

0

frequency respons of halfband filter? - alex65111 - 2009-04-15 17:31:00

Let the halfband filter is defined

H=[0.033402 0 -0.015082	0 0.018968 0 -0.024143	0 0.031336 0 -0.042322	0 
0.061361 0 -0.10468 0 0.31784 0.5 0.31784 0 -0.10468 0 0.061361 0 -0.042322
0 0.031336 0 -0.024143	0 0.018968 0 -0.015082	0 0.033402];

According to property of the halfband filter it has suppression on 1/4
sampling frequency 6dB.

Fxÿt(H,1024);
plot(20*log10(abs(Fx)))

Let's calculate the frequency response

s1=[zeros(1,128) 1 zeros(1,128)]; 
s_f=filter(H,1,s1); 
s_f=s_f(1:2:end); 
figure, plot(20*log10(abs(fft(s_f))))

On figure it is clearly visible, that on half of new sampling of frequency
instead of 3dB suppression actually it is more than  15dB suppression.


Why at calculation of the frequency response instead of expected 3dB
actually it appears much more?

If to generate a signal on frequency of 1/4 sampling frequencies, to pass
it through the halfband filter and then to decimate

t=0:1023;
s=sin(2*pi*0.24999*t)+0.1*randn(1,length(t));

s_f1=filter(H,1,s); 
s_f1=s_f1(1:2:end); 
figure, plot(20*log10(abs(fft(s_f1))))

that will be visible, that suppression of this frequency will be not such
what should be according to the frequency response. 
Why?


Re: frequency respons of halfband filter? - jim - 2009-04-15 18:17:00

Does the sum of your coefficients equal 1?

-jim

alex65111 wrote:
> 
> Let the halfband filter is defined
> 
> H=[0.033402 0 -0.015082 0 0.018968 0 -0.024143  0 0.031336 0 -0.042322  0
> 0.061361 0 -0.10468 0 0.31784 0.5 0.31784 0 -0.10468 0 0.061361 0 -0.042322
> 0 0.031336 0 -0.024143  0 0.018968 0 -0.015082  0 0.033402];
> 
> According to property of the halfband filter it has suppression on 1/4
> sampling frequency 6dB.
> 
> Fxÿt(H,1024);
> plot(20*log10(abs(Fx)))
> 
> Let's calculate the frequency response
> 
> s1=[zeros(1,128) 1 zeros(1,128)];
> s_f=filter(H,1,s1);
> s_f=s_f(1:2:end);
> figure, plot(20*log10(abs(fft(s_f))))
> 
> On figure it is clearly visible, that on half of new sampling of frequency
> instead of 3dB suppression actually it is more than  15dB suppression.
> 
> Why at calculation of the frequency response instead of expected 3dB
> actually it appears much more?
> 
> If to generate a signal on frequency of 1/4 sampling frequencies, to pass
> it through the halfband filter and then to decimate
> 
> t=0:1023;
> s=sin(2*pi*0.24999*t)+0.1*randn(1,length(t));
> 
> s_f1=filter(H,1,s);
> s_f1=s_f1(1:2:end);
> figure, plot(20*log10(abs(fft(s_f1))))
> 
> that will be visible, that suppression of this frequency will be not such
> what should be according to the frequency response.
> Why?


Re: frequency respons of halfband filter? - alex65111 - 2009-04-15 18:35:00

>Does the sum of your coefficients equal 1?
>
>-jim
>

It unless concerns that that at calculation of the frequency response on
frequency on 1/2 new sampling frequency, suppression appears distinct from
3dB?

P.S. Coefficients have been calculated in fdatool (matlab).


Re: frequency respons of halfband filter? - jim - 2009-04-15 19:03:00

alex65111 wrote:
> 
> >Does the sum of your coefficients equal 1?
> >
> >-jim
> >
> 
> It unless concerns that that at calculation of the frequency response on
> frequency on 1/2 new sampling frequency, suppression appears distinct from
> 3dB?

Sorry I don't speak that language. The question I asked could be
answered with yes or no.

-jim

> 
> P.S. Coefficients have been calculated in fdatool (matlab).


Re: frequency respons of halfband filter? - 2009-04-15 20:46:00

On Apr 15, 5:31 pm, "alex65111" <alex65...@list.ru> wrote:
> Let the halfband filter is defined
>
> H=[0.033402 0 -0.015082 0 0.018968 0 -0.024143  0 0.031336 0 -0.042322  0
> 0.061361 0 -0.10468 0 0.31784 0.5 0.31784 0 -0.10468 0 0.061361 0 -0.042322
> 0 0.031336 0 -0.024143  0 0.018968 0 -0.015082  0 0.033402];
>
> According to property of the halfband filter it has suppression on 1/4
> sampling frequency 6dB.
>
> Fx=fft(H,1024);
> plot(20*log10(abs(Fx)))
>
> Let's calculate the frequency response
>
> s1=[zeros(1,128) 1 zeros(1,128)];
> s_f=filter(H,1,s1);
> s_f=s_f(1:2:end);
> figure, plot(20*log10(abs(fft(s_f))))
>
> On figure it is clearly visible, that on half of new sampling of frequency
> instead of 3dB suppression actually it is more than  15dB suppression.

Where did you get this idea? If you decimate the filter response to
kill the DC offset you get zero.

>
> Why at calculation of the frequency response instead of expected 3dB
> actually it appears much more?
>
> If to generate a signal on frequency of 1/4 sampling frequencies, to pass
> it through the halfband filter and then to decimate
>
> t=0:1023;
> s=sin(2*pi*0.24999*t)+0.1*randn(1,length(t));
>
> s_f1=filter(H,1,s);
> s_f1=s_f1(1:2:end);
> figure, plot(20*log10(abs(fft(s_f1))))
>
> that will be visible, that suppression of this frequency will be not such
> what should be according to the frequency response.
> Why?


================   TRY THIS ... AND THINK!!!! ==============


clear all; close all; eps=10^-7;

H1=[0.033402 0 -0.015082 0 0.018968 0 -0.024143  0 0.031336 0
-0.042322  0 ...
0.061361 0 -0.10468 0 0.31784 0.5 0.31784 0 -0.10468 0 0.061361 0
-0.042322 ...
0 0.031336 0 -0.024143  0 0.018968 0 -0.015082  0 0.033402];

H2=H1; H2((length(H2)+1)/2)=0;  % reset 0.5 to 0

%According to property of the halfband filter it has suppression on
1/4
%sampling frequency 6dB.

Fx1=fft(H1,1024);

f=(0:1023)/1024;
figure(1); plot(f,20*log10(abs(Fx1)+eps)); grid on;
title('Plot 1');

Fx2=fft(H2,1024);

f=(0:1023)/1024;
figure(2); plot(f,20*log10(abs(Fx2)+eps)); grid on;
title('Plot 2 - makes sense');


%Let's calculate the frequency response of decimated filter response
which
% eliminates zeroes and the 0.5 offset. Value at new f/4 should be sum
of
% all coefficients except 0.5 .


s1=[zeros(1,128) 1 zeros(1,128)];
s_f1=filter(H1,1,s1);
s_f1=s_f1(1:2:end);

fd=(0:length(s_f1)-1)/length(s_f1);
figure(3); plot(fd, 20*log10(abs(fft(s_f1))+eps)); grid on;
title('Plot 3 - makes sense');

======================================

SplatSpam


Re: frequency respons of halfband filter? - alex65111 - 2009-04-16 04:32:00

Sorry, but I not understand your thought. Why decimated filter response 
eliminates  the 0.5 offset?

If I do so

Fx3_1«s(Fx1(1:512));
Fx3_2«s(Fx1(513:1024)); 
plot(20*log10(Fx3_1+eps))
hold on
plot(20*log10(Fx3_2+eps),'r')
hold off

that I receive that in a point 0.25 (0.5 after decimate) suppression
corresponds 6dB.

But if I try to construct the characteristic of system by giving on an
input of system of an impulse ([0 0 1 0 0]->filter->decimate->impulse
response->fft), that I receive that in a point 0.25 (0.5) suppression
corresponds >>6dB (approximately 20dB).

And if on a system input to give a signal on frequency 0.25 on an output
suppression there will be the same 6dB, but not 20dB.

Thus it turns out that at giving [0 1 0] on frequency 0.25(0.5 after
decimate)  suppression appears 20dB, and at giving sin(0.25) suppression
appears 6dB.


Re: frequency respons of halfband filter? - Fred Marshall - 2009-04-16 11:45:00

alex65111 wrote:
> Let the halfband filter is defined
>
> H=[0.033402 0 -0.015082 0 0.018968 0 -0.024143 0 0.031336 0 -0.042322
> 0
> 0.061361 0 -0.10468 0 0.31784 0.5 0.31784 0 -0.10468 0 0.061361 0
> -0.042322 0 0.031336 0 -0.024143 0 0.018968 0 -0.015082 0 0.033402];
>
> According to property of the halfband filter it has suppression on 1/4
> sampling frequency 6dB.
>
> Fxÿt(H,1024);
> plot(20*log10(abs(Fx)))
>
> Let's calculate the frequency response
>
> s1=[zeros(1,128) 1 zeros(1,128)];
> s_f=filter(H,1,s1);
> s_f=s_f(1:2:end);
> figure, plot(20*log10(abs(fft(s_f))))
>
> On figure it is clearly visible, that on half of new sampling of
> frequency instead of 3dB suppression actually it is more than  15dB
> suppression.
>
>
> Why at calculation of the frequency response instead of expected 3dB
> actually it appears much more?
>
> If to generate a signal on frequency of 1/4 sampling frequencies, to
> pass it through the halfband filter and then to decimate
>
> t=0:1023;
> s=sin(2*pi*0.24999*t)+0.1*randn(1,length(t));
>
> s_f1=filter(H,1,s);
> s_f1=s_f1(1:2:end);
> figure, plot(20*log10(abs(fft(s_f1))))
>
> that will be visible, that suppression of this frequency will be not
> such what should be according to the frequency response.
> Why?

Check your code.  An FFT of the filter yields the correct response it 
appears.

Fred


Re: frequency respons of halfband filter? - 2009-04-16 23:01:00

On Apr 16, 4:32 am, "alex65111" <alex65...@list.ru> wrote:
> Sorry, but I not understand your thought. Why decimated filter response
> eliminates  the 0.5 offset?

Because it eliminates it from the impulse response, you throw it away.
The second fequency response you are trying to compute is not real
meaningful because you are not considering that the combined frequency
response and signal spectrum above the original fs/2 BW aliases into
the new fs/2 BW (old fs/4 BW).  You need to draw some pictures.

Dirk

>
> If I do so
>
> Fx3_1=abs(Fx1(1:512));
> Fx3_2=abs(Fx1(513:1024));
> plot(20*log10(Fx3_1+eps))
> hold on
> plot(20*log10(Fx3_2+eps),'r')
> hold off
>
> that I receive that in a point 0.25 (0.5 after decimate) suppression
> corresponds 6dB.
>
> But if I try to construct the characteristic of system by giving on an
> input of system of an impulse ([0 0 1 0 0]->filter->decimate->impulse
> response->fft), that I receive that in a point 0.25 (0.5) suppression
> corresponds >>6dB (approximately 20dB).
>
> And if on a system input to give a signal on frequency 0.25 on an output
> suppression there will be the same 6dB, but not 20dB.
>
> Thus it turns out that at giving [0 1 0] on frequency 0.25(0.5 after
> decimate)  suppression appears 20dB, and at giving sin(0.25) suppression
> appears 6dB.


Re: frequency respons of halfband filter? - alex65111 - 2009-04-17 00:58:00

All thanks for attempts to help me but I have not understood where I am
mistaken.

Let's try to ask a question easier and particularly.

Let's assume at us there is a system consisting of the filter and
following for it decimation.

The impulse response of filter

H=[0.033402 0 -0.015082	0 0.018968 0 -0.024143	0 0.031336 0 -0.042322	0 
0.061361 0 -0.10468 0 0.31784 0.5 0.31784 0 -0.10468 0 0.061361 0 
-0.042322 0 0.031336 0 -0.024143	0 0.018968 0 -0.015082	0 0.033402];

Decimation factor is 2.

How correctly to calculate the combined characteristic of system as a
whole? 

The calculated characteristic should show what suppression on frequency
0.5 (after decimation)?


Re: frequency respons of halfband filter? - 2009-04-17 11:13:00

On Apr 17, 12:58 am, "alex65111" <alex65...@list.ru> wrote:
> All thanks for attempts to help me but I have not understood where I am
> mistaken.
>
> Let's try to ask a question easier and particularly.
>
> Let's assume at us there is a system consisting of the filter and
> following for it decimation.
>
> The impulse response of filter
>
> H=[0.033402 0 -0.015082 0 0.018968 0 -0.024143  0 0.031336 0 -0.042322  0
> 0.061361 0 -0.10468 0 0.31784 0.5 0.31784 0 -0.10468 0 0.061361 0
> -0.042322 0 0.031336 0 -0.024143        0 0.018968 0 -0.015082  0 0.033402];
>
> Decimation factor is 2.
>
> How correctly to calculate the combined characteristic of system as a
> whole?
>
> The calculated characteristic should show what suppression on frequency
> 0.5 (after decimation)?

Alex,

You are not going to be able to get a frequency response of this
system because of the aliasing below 0.5. In the aliased region the
frequency response would not be defined in any meaningful way. You
need to understand what the filter does. Draw pictures.

Dirk


| 1 | | 3 |