DSPRelated.com
Forums

How to make a filter with a frequency response of 1/(a^2+w^2)?

Started by kavo...@gmail.com March 11, 2006
Hi everybody,

First I like to appologize because my question is some how stupid, since I am
mechanical engineer student and new in signal processing,

I need to generate a random signal with a desired PSD, I found that this problem
was asked before by Tony and Nandan gave him the answer.

What Nandan said was to generate a white signal (uniform PSD) and then pass it
through a filter whose frequency response is sqrt of the desired PSD. My goal
PSD is 1/(a^2+w^2) in which a is a constant and w is frequency.

My question is how I can make a filter with a frequency response of
sqrt(1/(a^2+w^2))? whould not it be nonlinear?

Any help is highly appreciated.

Thanks 
kavous
	
You can generate such a filter by using the command invfreqs

[B,A] = INVFREQS(H,W,'complex',NB,NA,...) creates a complex filter. 
In
    this case, no symmetry is enforced.

H = desired response of filter (in your case sqrt(1/(a^2+w^2))
W = corresponding vector of w
NB = order of B
NA = order of A

This will give the best least squares fit to your desired freq response.

If you make the orders reasonably large, you can get a very good match.

hope this helps,
Nandan
	On 3/11/06, kavousj@kavo... <kavousj@kavo...> wrote:
>
> Hi everybody,
>
> First I like to appologize because my question is some how stupid, since I
> am mechanical engineer student and new in signal processing,
>
> I need to generate a random signal with a desired PSD, I found that this
> problem was asked before by Tony and Nandan gave him the answer.
>
> What Nandan said was to generate a white signal (uniform PSD) and then
> pass it through a filter whose frequency response is sqrt of the desired
> PSD. My goal PSD is 1/(a^2+w^2) in which a is a constant and w is
frequency.
>
> My question is how I can make a filter with a frequency response of
> sqrt(1/(a^2+w^2))? whould not it be nonlinear?
>
> Any help is highly appreciated.
>
> Thanks
> kavous
>
	
Hello, 
         I simulated the SPACE TIME BLOCK CODED system
based on 
Alamouti scheme, where the modulation is BPSK. Now I
am trying to 
extend that to QPSK and higher modulations. 
Since for SISO channels, BER curve for BPSK and QPSK
is equal in AWGN 
and flat fading channels. 
Will the BER curve for BPSK and QPSK will be same in
Alamouti based 
scheme? 
Any help in this regard is highly appreciated. 

Thanks and Regards, 
-SaiRamesh.
	
A method is simply presented as follows,which can be found in many books:
the psd of the filtered white noise is S_y(w) = N*|H(w)|^2.
H(w) is the frequency response of the linear filter. Hence root(1/(a^2+w^2))
So you may sample in the frequency domain, Then the matlab function
"fir2"
will be helpful

2006/3/12, kavousj@kavo... <kavousj@kavo...>:

> Hi everybody,
>
> First I like to appologize because my question is some how stupid, since I
> am mechanical engineer student and new in signal processing,
>
> I need to generate a random signal with a desired PSD, I found that this
> problem was asked before by Tony and Nandan gave him the answer.
>
> What Nandan said was to generate a white signal (uniform PSD) and then
> pass it through a filter whose frequency response is sqrt of the desired
> PSD. My goal PSD is 1/(a^2+w^2) in which a is a constant and w is
frequency.
>
> My question is how I can make a filter with a frequency response of
> sqrt(1/(a^2+w^2))? whould not it be nonlinear?
>
> Any help is highly appreciated.
>
> Thanks
> kavous
>
	
  
Ofcourse yes, it will be the same.
Bcos what determines the performance in a space-time coded system is the minimum
determinant of the ST codeword. For any orthogonal design minimum determinant is
equal to the min. equilidean distance of the signal set(QPSK) in ur case. Since
alamouti code is an orthogonal design and min. equilidean distance of BPSK and
QPSK are same, the performance will be the same.

Susinder rajan
http://geocities.com/susinderrajan

On Mon, 13 Mar 2006 nammi sairamesh wrote :
>Hello,
>         I simulated the SPACE TIME BLOCK CODED system
>based on
>Alamouti scheme, where the modulation is BPSK. Now I
>am trying to
>extend that to QPSK and higher modulations.
>Since for SISO channels, BER curve for BPSK and QPSK
>is equal in AWGN
>and flat fading channels.
>Will the BER curve for BPSK and QPSK will be same in
>Alamouti based
>scheme?
>Any help in this regard is highly appreciated.
>Thanks and Regards,
>-SaiRamesh.
	
Thanks for all but I still have problem creating the filter. I followed the
method that Nandan said, but the command gave me the cofficient of the
denumenator such that the filter was unstable so I could not filter my data.
I changed the orders NA and NB so many times but I could not get a stable
transfer function.
I think I should use "fitmag" command. should not I?
	On 3/12/06, Nandan Das <nandan@nand...> wrote:
>
>  You can generate such a filter by using the command invfreqs
>
> [B,A] = INVFREQS(H,W,'complex',NB,NA,...) creates a complex
filter.  In
>     this case, no symmetry is enforced.
>
> H = desired response of filter (in your case sqrt(1/(a^2+w^2))
> W = corresponding vector of w
> NB = order of B
> NA = order of A
>
> This will give the best least squares fit to your desired freq response.
>
> If you make the orders reasonably large, you can get a very good match.
>
> hope this helps,
>
> Nandan
>
>
>  On 3/11/06, kavousj@kavo... <kavousj@kavo...> wrote:
>
> > Hi everybody,
>
> First I like to appologize because my question is some how stupid, since I
> am mechanical engineer student and new in signal processing,
>
> I need to generate a random signal with a desired PSD, I found that this
> problem was asked before by Tony and Nandan gave him the answer.
>
> What Nandan said was to generate a white signal (uniform PSD) and then
> pass it through a filter whose frequency response is sqrt of the desired
> PSD. My goal PSD is 1/(a^2+w^2) in which a is a constant and w is
frequency.
>
>
> My question is how I can make a filter with a frequency response of
> sqrt(1/(a^2+w^2))? whould not it be nonlinear?
>
> Any help is highly appreciated.
>
> Thanks
> kavous
>
	
You can either do a FIR only filter (and thus be guaranteed of stability),
or do the following which I copied directly from Matlab help.

    [B,A] = INVFREQS(H,W,nb,na,Wt,ITER) does another type of fit:
    Sum |B/A-H|^2*Wt is minimized with respect to the coefficients in B and
    A by numerical search in at most ITER iterations.  The A-polynomial is
    then constrained to be stable.  [B,A]=INVFREQS(H,W,nb,na,Wt,ITER,TOL)
    stops the iterations when the norm of the gradient is less than TOL.
    The default value of TOL is 0.01.  The default value of Wt is all ones.
    This default value is also obtained by Wt=[].

Does this help?

thanks
Nandan
	On 3/13/06, kavous jorabchi <kavousj@kavo...> wrote:
>
> Thanks for all but I still have problem creating the filter. I followed
> the method that Nandan said, but the command gave me the cofficient of the
> denumenator such that the filter was unstable so I could not filter my
data.
> I changed the orders NA and NB so many times but I could not get a stable
> transfer function.
> I think I should use "fitmag" command. should not I?
>
>
> On 3/12/06, Nandan Das <nandan@nand...> wrote:
> >
> >  You can generate such a filter by using the command invfreqs
> >
> > [B,A] = INVFREQS(H,W,'complex',NB,NA,...) creates a complex
filter.  In
> >     this case, no symmetry is enforced.
> >
> > H = desired response of filter (in your case sqrt(1/(a^2+w^2))
> > W = corresponding vector of w
> > NB = order of B
> > NA = order of A
> >
> > This will give the best least squares fit to your desired freq
response.
> >
> > If you make the orders reasonably large, you can get a very good
match.
> >
> > hope this helps,
> >
> > Nandan
> >
> >
> >  On 3/11/06, kavousj@kavo... <kavousj@kavo...> wrote:
> >
> > > Hi everybody,
> >
> > First I like to appologize because my question is some how stupid,
since
> > I am mechanical engineer student and new in signal processing,
> >
> > I need to generate a random signal with a desired PSD, I found that
this
> > problem was asked before by Tony and Nandan gave him the answer.
> >
> > What Nandan said was to generate a white signal (uniform PSD) and then
> > pass it through a filter whose frequency response is sqrt of the
desired
> > PSD. My goal PSD is 1/(a^2+w^2) in which a is a constant and w is
frequency.
> >
> >
> > My question is how I can make a filter with a frequency response of
> > sqrt(1/(a^2+w^2))? whould not it be nonlinear?
> >
> > Any help is highly appreciated.
> >
> > Thanks
> > kavous
	
I would like to thank all specially Nandan whose comments were of great
help
for me.

Thanks
kavous
	On 3/13/06, Nandan Das <nandan@nand...> wrote:
>
> You can either do a FIR only filter (and thus be guaranteed of stability),
> or do the following which I copied directly from Matlab help.
>
>     [B,A] = INVFREQS(H,W,nb,na,Wt,ITER) does another type of fit:
>     Sum |B/A-H|^2*Wt is minimized with respect to the coefficients in B
> and
>     A by numerical search in at most ITER iterations.  The A-polynomial is
>
>     then constrained to be stable.  [B,A]=INVFREQS(H,W,nb,na,Wt,ITER,TOL)
>     stops the iterations when the norm of the gradient is less than TOL.
>     The default value of TOL is 0.01.  The default value of Wt is all
> ones.
>     This default value is also obtained by Wt=[].
>
> Does this help?
>
> thanks
>
> Nandan
>
>
>
> On 3/13/06, kavous jorabchi <kavousj@kavo...> wrote:
> >
> >  Thanks for all but I still have problem creating the filter. I
followed
> > the method that Nandan said, but the command gave me the cofficient of
the
> > denumenator such that the filter was unstable so I could not filter my
data.
> > I changed the orders NA and NB so many times but I could not get a
stable
> > transfer function.
> > I think I should use "fitmag" command. should not I?
> >
> >
> >  On 3/12/06, Nandan Das <nandan@nand...> wrote:
> > >
> > >  You can generate such a filter by using the command invfreqs
> > >
> > > [B,A] = INVFREQS(H,W,'complex',NB,NA,...) creates a
complex filter.
> > > In
> > >     this case, no symmetry is enforced.
> > >
> > > H = desired response of filter (in your case
sqrt(1/(a^2+w^2))
> > > W = corresponding vector of w
> > > NB = order of B
> > > NA = order of A
> > >
> > > This will give the best least squares fit to your desired freq
> > > response.
> > >
> > > If you make the orders reasonably large, you can get a very good
> > > match.
> > >
> > > hope this helps,
> > >
> > > Nandan
> > >
> > >
> > >  On 3/11/06, kavousj@kavo... <kavousj@kavo...> wrote:
> > >
> > > > Hi everybody,
> > >
> > > First I like to appologize because my question is some how
stupid,
> > > since I am mechanical engineer student and new in signal
processing,
> > >
> > > I need to generate a random signal with a desired PSD, I found
that
> > > this problem was asked before by Tony and Nandan gave him the
answer.
> > >
> > > What Nandan said was to generate a white signal (uniform PSD) and
then
> > > pass it through a filter whose frequency response is sqrt of the
desired
> > > PSD. My goal PSD is 1/(a^2+w^2) in which a is a constant and
w is frequency.
> > >
> > >
> > > My question is how I can make a filter with a frequency response
of
> > > sqrt(1/(a^2+w^2))? whould not it be nonlinear?
> > >
> > > Any help is highly appreciated.
> > >
> > > Thanks
> > > kavous