Hi all,
I have a relatively basic question about applying a bilinea
transformation using MATLAB. I am familiar with the bilinear function, bu
the question states the following:
apply the bilinear transform to Ha(s) in order to obtain H(z) such that w
= pi/4 radians.
Ha(s) = 20/(s^4 + 2s^3 + 8s^2 + 20s + 20)
my question/confusion is where does the w1 play a role in this?
On May 12, 8:28*am, "v333k" <v3...@yahoo.com> wrote:
> Hi all,
> I have a relatively basic question about applying a bilinear
> transformation using MATLAB. *I am familiar with the bilinear function,but
> the question states the following:
> apply the bilinear transform to Ha(s) in order to obtain H(z) such that w1
> = pi/4 radians.
>
> Ha(s) = 20/(s^4 + 2s^3 + 8s^2 + 20s + 20)
>
> my question/confusion is where does the w1 play a role in this?
>
> thanks in advance!
Perhaps this question has some context around it that you are not
posting here. In general the bilinear transform does a mapping between
Laplace and z-domains where 0 -> 0 and infinity -> pi and then a third
point is adjustable in the sense of where you do the mapping. I.e.
this is the "c" or whatever stadard variable you see in the bilinear
transform. s = c (1-z^-1)/(1+z^-1) sometimes the "c" is written as 2/
T where "T" is the sampling period. If the Laplace expression is
normalized to 1 rad/sec, then "c" is simply cot(pi*f) where "f" is the
normalized digital frequency that gets mapped to 1 rad/sec.
>On May 12, 8:28=A0am, "v333k" <v3...@yahoo.com> wrote:
>> Hi all,
>> I have a relatively basic question about applying a bilinear
>> transformation using MATLAB. =A0I am familiar with the bilinea
function,=
> but
>> the question states the following:
>> apply the bilinear transform to Ha(s) in order to obtain H(z) such tha
w=
>1
>> =3D pi/4 radians.
>>
>> Ha(s) =3D 20/(s^4 + 2s^3 + 8s^2 + 20s + 20)
>>
>> my question/confusion is where does the w1 play a role in this?
>>
>> thanks in advance!
>
>Perhaps this question has some context around it that you are not
>posting here. In general the bilinear transform does a mapping between
>Laplace and z-domains where 0 -> 0 and infinity -> pi and then a third
>point is adjustable in the sense of where you do the mapping. I.e.
>this is the "c" or whatever stadard variable you see in the bilinear
>transform. s =3D c (1-z^-1)/(1+z^-1) sometimes the "c" is written as 2/
>T where "T" is the sampling period. If the Laplace expression is
>normalized to 1 rad/sec, then "c" is simply cot(pi*f) where "f" is the
>normalized digital frequency that gets mapped to 1 rad/sec.
>
>Clay
>
Hi Clay,
thanks for your reply.
Since I am not fully understanding the question, maybe I left some inf
out thinking that it is irrelevant. The first part of the question aske
to plot the Ha(s) phase response in degrees and find the frequency OMEGA
when the phase is at -71 degrees).
The second part was asking the original question in this thread, and th
part I left out was w1 is the digital counterpart of OMEGA1). Also, w
need to consider the frequency range 0<=OMEGA<=4 rad/sec.
On May 13, 1:24*pm, "v333k" <v3...@yahoo.com> wrote:
> >On May 12, 8:28=A0am, "v333k" <v3...@yahoo.com> wrote:
> >> Hi all,
> >> I have a relatively basic question about applying a bilinear
> >> transformation using MATLAB. =A0I am familiar with the bilinear
> function,=
> > but
> >> the question states the following:
> >> apply the bilinear transform to Ha(s) in order to obtain H(z) such that
> w=
> >1
> >> =3D pi/4 radians.
>
> >> Ha(s) =3D 20/(s^4 + 2s^3 + 8s^2 + 20s + 20)
>
> >> my question/confusion is where does the w1 play a role in this?
>
> >> thanks in advance!
>
> >Perhaps this question has some context around it that you are not
> >posting here. In general the bilinear transform does a mapping between
> >Laplace and z-domains where 0 -> 0 and infinity -> pi and then a third
> >point is adjustable in the sense of where you do the mapping. I.e.
> >this is the "c" or whatever stadard variable you see in the bilinear
> >transform. *s =3D c (1-z^-1)/(1+z^-1) sometimes the "c" is written as 2/
> >T where "T" is the sampling period. *If the Laplace expression is
> >normalized to 1 rad/sec, then "c" is simply cot(pi*f) where "f" is the
> >normalized digital frequency that gets mapped to 1 rad/sec.
>
> >Clay
>
> Hi Clay,
> thanks for your reply.
> Since I am not fully understanding the question, maybe I left some info
> out thinking that it is irrelevant. *The first part of the question asked
> to plot the Ha(s) phase response in degrees and find the frequency OMEGA1
> when the phase is at -71 degrees).
> The second part was asking the original question in this thread, and the
> part I left out was w1 is the digital counterpart of OMEGA1). *Also, we
> need to consider the frequency range 0<=OMEGA<=4 rad/sec.
>
> Thanks in advance (again).
>
> v333k- Hide quoted text -
>
> - Show quoted text -
Now what you have added makes sense - thanks.
On your part A of the problem, I hope you found two spots where the
phase is -71 degrees. For these two spots OMEGA = approx 1.43 or 2.40
radians/sec.
For your bilinear transform, use
s = c (1-z^-1)/(1+z^-1)
here c=OMEGA*cot(omega/2) where OMEGA is the analog frequency that we
are mapping to the digital frequency omega. For your case omega = pi/4
and OMEGA is equal to 1.43 or the 2.40 radians/sec number.
These two values give a "c" equal to approx 3.45 or 5.78. You will
need to do this in full precision to get it to work well, but when you
get your bilinear transformed function, graph its phase and check the
location of the -71 degree spots. It should be right where the "c"
equation puts it.
>On May 13, 1:24=A0pm, "v333k" <v3...@yahoo.com> wrote:
>> >On May 12, 8:28=3DA0am, "v333k" <v3...@yahoo.com> wrote:
>> >> Hi all,
>> >> I have a relatively basic question about applying a bilinear
>> >> transformation using MATLAB. =3DA0I am familiar with the bilinear
>> function,=3D
>> > but
>> >> the question states the following:
>> >> apply the bilinear transform to Ha(s) in order to obtain H(z) suc
tha=
>t
>> w=3D
>> >1
>> >> =3D3D pi/4 radians.
>>
>> >> Ha(s) =3D3D 20/(s^4 + 2s^3 + 8s^2 + 20s + 20)
>>
>> >> my question/confusion is where does the w1 play a role in this?
>>
>> >> thanks in advance!
>>
>> >Perhaps this question has some context around it that you are not
>> >posting here. In general the bilinear transform does a mappin
between
>> >Laplace and z-domains where 0 -> 0 and infinity -> pi and then
third
>> >point is adjustable in the sense of where you do the mapping. I.e.
>> >this is the "c" or whatever stadard variable you see in the bilinear
>> >transform. =A0s =3D3D c (1-z^-1)/(1+z^-1) sometimes the "c" is writte
a=
>s 2/
>> >T where "T" is the sampling period. =A0If the Laplace expression is
>> >normalized to 1 rad/sec, then "c" is simply cot(pi*f) where "f" i
the
>> >normalized digital frequency that gets mapped to 1 rad/sec.
>>
>> >Clay
>>
>> Hi Clay,
>> thanks for your reply.
>> Since I am not fully understanding the question, maybe I left som
info
>> out thinking that it is irrelevant. =A0The first part of the questio
ask=
>ed
>> to plot the Ha(s) phase response in degrees and find the frequenc
OMEGA1
>> when the phase is at -71 degrees).
>> The second part was asking the original question in this thread, an
the
>> part I left out was w1 is the digital counterpart of OMEGA1). =A0Also
we
>> need to consider the frequency range 0<=3DOMEGA<=3D4 rad/sec.
>>
>> Thanks in advance (again).
>>
>> v333k- Hide quoted text -
>>
>> - Show quoted text -
>
>Now what you have added makes sense - thanks.
>
>
>On your part A of the problem, I hope you found two spots where the
>phase is -71 degrees. For these two spots OMEGA =3D approx 1.43 or 2.40
>radians/sec.
>
>
>For your bilinear transform, use
>
>s =3D c (1-z^-1)/(1+z^-1)
>
>
>here c=3DOMEGA*cot(omega/2) where OMEGA is the analog frequency that we
>are mapping to the digital frequency omega. For your case omega =3D pi/4
>and OMEGA is equal to 1.43 or the 2.40 radians/sec number.
>
>These two values give a "c" equal to approx 3.45 or 5.78. You will
>need to do this in full precision to get it to work well, but when you
>get your bilinear transformed function, graph its phase and check the
>location of the -71 degree spots. It should be right where the "c"
>equation puts it.
>
>IHTH,
>
>Clay
>
>
I Clay,
Thank you very much for the time you took to explain this to me.
The only thing that I can't figure out (yet) is the last part, where yo
say "graph its phase and check the location of the -71 degrees spot. I
should be right where the "c" equation puts it."
When I graph the phase, I get 0.11 for 71 degrees. I know I am doin
something wrong, but I can't seem to see my mistake. Here is the MATLA
code I am using:
OMEGA_MAX = 4;
num_samples = 1000;
W = [0:1:num_samples]*OMEGA_MAX/num_samples;
B = 105;
A = [1 9.992 44.9534 104.9207 104.99118];
freqs(B,A,W);
w1 = 0.25*pi; %pi/4
c = 1.43*cot(w1/2);
[b,a] = bilinear(B,A,c);
>>On May 13, 1:24=A0pm, "v333k" <v3...@yahoo.com> wrote:
>>> >On May 12, 8:28=3DA0am, "v333k" <v3...@yahoo.com> wrote:
>>> >> Hi all,
>>> >> I have a relatively basic question about applying a bilinear
>>> >> transformation using MATLAB. =3DA0I am familiar with the bilinear
>>> function,=3D
>>> > but
>>> >> the question states the following:
>>> >> apply the bilinear transform to Ha(s) in order to obtain H(z) such
>tha=
>>t
>>> w=3D
>>> >1
>>> >> =3D3D pi/4 radians.
>>>
>>> >> Ha(s) =3D3D 20/(s^4 + 2s^3 + 8s^2 + 20s + 20)
>>>
>>> >> my question/confusion is where does the w1 play a role in this?
>>>
>>> >> thanks in advance!
>>>
>>> >Perhaps this question has some context around it that you are not
>>> >posting here. In general the bilinear transform does a mapping
>between
>>> >Laplace and z-domains where 0 -> 0 and infinity -> pi and then a
>third
>>> >point is adjustable in the sense of where you do the mapping. I.e.
>>> >this is the "c" or whatever stadard variable you see in the bilinear
>>> >transform. =A0s =3D3D c (1-z^-1)/(1+z^-1) sometimes the "c" i
written
>a=
>>s 2/
>>> >T where "T" is the sampling period. =A0If the Laplace expression is
>>> >normalized to 1 rad/sec, then "c" is simply cot(pi*f) where "f" is
>the
>>> >normalized digital frequency that gets mapped to 1 rad/sec.
>>>
>>> >Clay
>>>
>>> Hi Clay,
>>> thanks for your reply.
>>> Since I am not fully understanding the question, maybe I left some
>info
>>> out thinking that it is irrelevant. =A0The first part of the question
>ask=
>>ed
>>> to plot the Ha(s) phase response in degrees and find the frequency
>OMEGA1
>>> when the phase is at -71 degrees).
>>> The second part was asking the original question in this thread, and
>the
>>> part I left out was w1 is the digital counterpart of OMEGA1)
=A0Also,
>we
>>> need to consider the frequency range 0<=3DOMEGA<=3D4 rad/sec.
>>>
>>> Thanks in advance (again).
>>>
>>> v333k- Hide quoted text -
>>>
>>> - Show quoted text -
>>
>>Now what you have added makes sense - thanks.
>>
>>
>>On your part A of the problem, I hope you found two spots where the
>>phase is -71 degrees. For these two spots OMEGA =3D approx 1.43 or 2.40
>>radians/sec.
>>
>>
>>For your bilinear transform, use
>>
>>s =3D c (1-z^-1)/(1+z^-1)
>>
>>
>>here c=3DOMEGA*cot(omega/2) where OMEGA is the analog frequency that we
>>are mapping to the digital frequency omega. For your case omega =3
pi/4
>>and OMEGA is equal to 1.43 or the 2.40 radians/sec number.
>>
>>These two values give a "c" equal to approx 3.45 or 5.78. You will
>>need to do this in full precision to get it to work well, but when you
>>get your bilinear transformed function, graph its phase and check the
>>location of the -71 degree spots. It should be right where the "c"
>>equation puts it.
>>
>>IHTH,
>>
>>Clay
>>
>>
Hi Clay,
Thank you very much for the time you took to explain this to me.
The only thing that I can't figure out (yet) is the last part, where you
say "graph its phase and check the location of the -71 degrees spot. It
should be right where the "c" equation puts it."
When I graph the phase, I get 0.11 for 71 degrees. I know I am doing
something wrong, but I can't seem to see my mistake. Here is the MATLAB
code I am using:
OMEGA_MAX = 4;
num_samples = 1000;
W = [0:1:num_samples]*OMEGA_MAX/num_samples;
B = 20;
A = [1 2 8 20 20];
freqs(B,A,W);
w1 = 0.25*pi; %pi/4
c = 1.43*cot(w1/2);
[b,a] = bilinear(B,A,c);
On May 15, 11:03*am, "v333k" <v3...@yahoo.com> wrote:
> >>On May 13, 1:24=A0pm, "v333k" <v3...@yahoo.com> wrote:
> >>> >On May 12, 8:28=3DA0am, "v333k" <v3...@yahoo.com> wrote:
> >>> >> Hi all,
> >>> >> I have a relatively basic question about applying a bilinear
> >>> >> transformation using MATLAB. =3DA0I am familiar with the bilinear
> >>> function,=3D
> >>> > but
> >>> >> the question states the following:
> >>> >> apply the bilinear transform to Ha(s) in order to obtain H(z) such
> >tha=
> >>t
> >>> w=3D
> >>> >1
> >>> >> =3D3D pi/4 radians.
>
> >>> >> Ha(s) =3D3D 20/(s^4 + 2s^3 + 8s^2 + 20s + 20)
>
> >>> >> my question/confusion is where does the w1 play a role in this?
>
> >>> >> thanks in advance!
>
> >>> >Perhaps this question has some context around it that you are not
> >>> >posting here. In general the bilinear transform does a mapping
> >between
> >>> >Laplace and z-domains where 0 -> 0 and infinity -> pi and then a
> >third
> >>> >point is adjustable in the sense of where you do the mapping. I.e.
> >>> >this is the "c" or whatever stadard variable you see in the bilinear
> >>> >transform. =A0s =3D3D c (1-z^-1)/(1+z^-1) sometimes the "c" is
> written
> >a=
> >>s 2/
> >>> >T where "T" is the sampling period. =A0If the Laplace expression is
> >>> >normalized to 1 rad/sec, then "c" is simply cot(pi*f) where "f" is
> >the
> >>> >normalized digital frequency that gets mapped to 1 rad/sec.
>
> >>> >Clay
>
> >>> Hi Clay,
> >>> thanks for your reply.
> >>> Since I am not fully understanding the question, maybe I left some
> >info
> >>> out thinking that it is irrelevant. =A0The first part of the question
> >ask=
> >>ed
> >>> to plot the Ha(s) phase response in degrees and find the frequency
> >OMEGA1
> >>> when the phase is at -71 degrees).
> >>> The second part was asking the original question in this thread, and
> >the
> >>> part I left out was w1 is the digital counterpart of OMEGA1).
> =A0Also,
> >we
> >>> need to consider the frequency range 0<=3DOMEGA<=3D4 rad/sec.
>
> >>> Thanks in advance (again).
>
> >>> v333k- Hide quoted text -
>
> >>> - Show quoted text -
>
> >>Now what you have added makes sense - thanks.
>
> >>On your part A of the problem, I hope you found two spots where the
> >>phase is -71 degrees. For these two spots OMEGA =3D approx 1.43 or 2.40
> >>radians/sec.
>
> >>For your bilinear transform, use
>
> >>s =3D c (1-z^-1)/(1+z^-1)
>
> >>here c=3DOMEGA*cot(omega/2) where OMEGA is the analog frequency that we
> >>are mapping to the digital frequency omega. For your case omega =3D
> pi/4
> >>and OMEGA is equal to 1.43 or the 2.40 radians/sec number.
>
> >>These two values give a "c" equal to approx 3.45 or 5.78. You will
> >>need to do this in full precision to get it to work well, but when you
> >>get your bilinear transformed function, graph its phase and check the
> >>location of the -71 degree spots. It should be right where the "c"
> >>equation puts it.
>
> >>IHTH,
>
> >>Clay
>
> Hi Clay,
> Thank you very much for the time you took to explain this to me.
> The only thing that I can't figure out (yet) is the last part, where you
> say "graph its phase and check the location of the -71 degrees spot. It
> should be right where the "c" equation puts it."
> When I graph the phase, I get 0.11 for 71 degrees. I know I am doing
> something wrong, but I can't seem to see my mistake. Here is the MATLAB
> code I am using:
>
> OMEGA_MAX = 4;
> num_samples = 1000;
> W = [0:1:num_samples]*OMEGA_MAX/num_samples;
>
> B = 20;
> A = [1 2 8 20 20];
>
> freqs(B,A,W);
>
> w1 = 0.25*pi; %pi/4
> c = 1.43*cot(w1/2);
> [b,a] = bilinear(B,A,c);
>
> figure;
> freqz(b,a); *% plot the frequency response
>
> Thanks once again.- Hide quoted text -
>
> - Show quoted text -
Since I don't use MatLab, I can't comment on the specifics of the
functions you are using. My last comment was basically was to note
that when you get your z-domain function via the bilinear transform
that the point of -71 degrees on the phase shift function now occurs
at pi/4. Essentially you need to evaluate your z domain eqn on the
unit circle and plot its phase vs frequency and the -71 spot should be
at the freq. of pi/4. This is a sanity check on you correctly doing
the bilinear transform. Oh yeah and make sure when you look at the
argument (phase) that you convert it to degrees if you are looking for
-71 degrees (-1.239 radians)
>On May 15, 11:03=A0am, "v333k" <v3...@yahoo.com> wrote:
>> >>On May 13, 1:24=3DA0pm, "v333k" <v3...@yahoo.com> wrote:
>> >>> >On May 12, 8:28=3D3DA0am, "v333k" <v3...@yahoo.com> wrote:
>> >>> >> Hi all,
>> >>> >> I have a relatively basic question about applying a bilinear
>> >>> >> transformation using MATLAB. =3D3DA0I am familiar with th
bilinea=
>r
>> >>> function,=3D3D
>> >>> > but
>> >>> >> the question states the following:
>> >>> >> apply the bilinear transform to Ha(s) in order to obtain H(z
such
>> >tha=3D
>> >>t
>> >>> w=3D3D
>> >>> >1
>> >>> >> =3D3D3D pi/4 radians.
>>
>> >>> >> Ha(s) =3D3D3D 20/(s^4 + 2s^3 + 8s^2 + 20s + 20)
>>
>> >>> >> my question/confusion is where does the w1 play a role in this?
>>
>> >>> >> thanks in advance!
>>
>> >>> >Perhaps this question has some context around it that you are not
>> >>> >posting here. In general the bilinear transform does a mapping
>> >between
>> >>> >Laplace and z-domains where 0 -> 0 and infinity -> pi and then a
>> >third
>> >>> >point is adjustable in the sense of where you do the mapping
I.e.
>> >>> >this is the "c" or whatever stadard variable you see in th
bilinear
>> >>> >transform. =3DA0s =3D3D3D c (1-z^-1)/(1+z^-1) sometimes the "c
is
>> written
>> >a=3D
>> >>s 2/
>> >>> >T where "T" is the sampling period. =3DA0If the Laplace expressio
i=
>s
>> >>> >normalized to 1 rad/sec, then "c" is simply cot(pi*f) where "f
is
>> >the
>> >>> >normalized digital frequency that gets mapped to 1 rad/sec.
>>
>> >>> >Clay
>>
>> >>> Hi Clay,
>> >>> thanks for your reply.
>> >>> Since I am not fully understanding the question, maybe I left some
>> >info
>> >>> out thinking that it is irrelevant. =3DA0The first part of th
questi=
>on
>> >ask=3D
>> >>ed
>> >>> to plot the Ha(s) phase response in degrees and find the frequency
>> >OMEGA1
>> >>> when the phase is at -71 degrees).
>> >>> The second part was asking the original question in this thread
and
>> >the
>> >>> part I left out was w1 is the digital counterpart of OMEGA1).
>> =3DA0Also,
>> >we
>> >>> need to consider the frequency range 0<=3D3DOMEGA<=3D3D4 rad/sec.
>>
>> >>> Thanks in advance (again).
>>
>> >>> v333k- Hide quoted text -
>>
>> >>> - Show quoted text -
>>
>> >>Now what you have added makes sense - thanks.
>>
>> >>On your part A of the problem, I hope you found two spots where the
>> >>phase is -71 degrees. For these two spots OMEGA =3D3D approx 1.43 o
2.=
>40
>> >>radians/sec.
>>
>> >>For your bilinear transform, use
>>
>> >>s =3D3D c (1-z^-1)/(1+z^-1)
>>
>> >>here c=3D3DOMEGA*cot(omega/2) where OMEGA is the analog frequenc
that =
>we
>> >>are mapping to the digital frequency omega. For your case omeg
=3D3D
>> pi/4
>> >>and OMEGA is equal to 1.43 or the 2.40 radians/sec number.
>>
>> >>These two values give a "c" equal to approx 3.45 or 5.78. You will
>> >>need to do this in full precision to get it to work well, but whe
you
>> >>get your bilinear transformed function, graph its phase and chec
the
>> >>location of the -71 degree spots. It should be right where the "c"
>> >>equation puts it.
>>
>> >>IHTH,
>>
>> >>Clay
>>
>> Hi Clay,
>> Thank you very much for the time you took to explain this to me.
>> The only thing that I can't figure out (yet) is the last part, wher
you
>> say "graph its phase and check the location of the -71 degrees spot
It
>> should be right where the "c" equation puts it."
>> When I graph the phase, I get 0.11 for 71 degrees. I know I am doing
>> something wrong, but I can't seem to see my mistake. Here is th
MATLAB
>> code I am using:
>>
>> OMEGA_MAX =3D 4;
>> num_samples =3D 1000;
>> W =3D [0:1:num_samples]*OMEGA_MAX/num_samples;
>>
>> B =3D 20;
>> A =3D [1 2 8 20 20];
>>
>> freqs(B,A,W);
>>
>> w1 =3D 0.25*pi; %pi/4
>> c =3D 1.43*cot(w1/2);
>> [b,a] =3D bilinear(B,A,c);
>>
>> figure;
>> freqz(b,a); =A0% plot the frequency response
>>
>> Thanks once again.- Hide quoted text -
>>
>> - Show quoted text -
>
>Since I don't use MatLab, I can't comment on the specifics of the
>functions you are using. My last comment was basically was to note
>that when you get your z-domain function via the bilinear transform
>that the point of -71 degrees on the phase shift function now occurs
>at pi/4. Essentially you need to evaluate your z domain eqn on the
>unit circle and plot its phase vs frequency and the -71 spot should be
>at the freq. of pi/4. This is a sanity check on you correctly doing
>the bilinear transform. Oh yeah and make sure when you look at the
>argument (phase) that you convert it to degrees if you are looking for
>-71 degrees (-1.239 radians)
>
>I hope this clarifies things,
>
>Clay
>
Hi Clay,
I think I understand it now.
Normally, as all books and examples, the equation for bilinear transform
is: s = 2/T(1-z^1)/(1+z^1)
However, the question I am working with is actually diverting from this
default parameter, and by mapping w1 (pi/4) to OMEGA1 which is found at -71
degrees of the phase shift.
So, what you were saying is the following:
eq1. s = 2/T(1-z^1)/(1+z^1)
eq2. W = 2/T *tan(w/2)
let c = 2/T
s = c * (1-z^1)/(1+z^1)
and from eq2, c = W/tan(w/2) = W * cot(w/2)
applying the bilinear transform:
I will obtain the digital coefficients of H(z) and when checking the phase
response plot at -71 degrees, I should get pi/4 which is the mapped
frequency.
This is great!
I really appreciate your time and effort!