Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js

Difference between revisions of "Aufgaben:Exercise 5.4: Sine Wave Generator"

From LNTwww
m (Text replacement - "”" to """)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  
{{quiz-Header|Buchseite=Stochastische Signaltheorie/Digitale Filter
+
{{quiz-Header|Buchseite=Theory_of_Stochastic_Signals/Digital_Filters
 
}}
 
}}
  
[[File:P_ID622__Sto_A_5_4.png|right|frame|Vorgeschlagene Filterstruktur]]
+
[[File:P_ID622__Sto_A_5_4.png|right|frame|Proposed filter structure]]
Die Grafik zeigt ein digitales Filter zweiter Ordnung, das zum Beispiel zur Erzeugung einer zeitdiskreten Sinusfunktion auf einem digitalen Signalprozessor (DSP) geeignet ist:
+
The diagram shows a second-order digital filter suitable for generating a discrete-time sinusoidal function on a digital signal processor  $\rm (DSP)$,  for example:
 
:yν=sin(νTω0).
 
:yν=sin(νTω0).
*Vorausgesetzt wird, dass die Eingangsfolge&nbsp; xν&nbsp; eine (zeitdiskrete) Diracfunktion beschreibt.&nbsp; Damit sind gleichzeitig alle Ausgangswerte&nbsp; yν&nbsp; für Zeiten&nbsp; ν<0&nbsp; identisch Null.
+
*It is assumed that the input sequence&nbsp; xν&nbsp; describes a&nbsp; (discrete-time)&nbsp; Dirac delta function.&nbsp; Thus,&nbsp; all output values&nbsp; yν&nbsp; are simultaneously identical to zero for times&nbsp; ν<0.&nbsp;  
*Die insgesamt fünf Filterkoeffizienten ergeben sich aus der&nbsp; [https://de.wikipedia.org/wiki/Z-Transformation Z-Transformation]:
+
*The total of five filter coefficients result from the&nbsp; [https://en.wikipedia.org/wiki/Z-transform Z-transform]:
 
:Z{sin(νTω0)}=zsin(ω0T)z22zcos(ω0T)+1.
 
:Z{sin(νTω0)}=zsin(ω0T)z22zcos(ω0T)+1.
*Setzt man diese Gleichung durch ein rekursives Filter zweiter Ordnung&nbsp; (M=2)&nbsp; um, so erhält man die folgenden Filterkoeffizienten:
+
*Substituting this equation by a recursive second order filter&nbsp; (M=2),&nbsp; we obtain the following filter coefficients:
 
:a0=0,a1=sin(ω0T),a2=0,b1=2cos(ω0T),b2=1.
 
:a0=0,a1=sin(ω0T),a2=0,b1=2cos(ω0T),b2=1.
  
In der Grafik ist bereits durch die hellere Umrandung markiert, dass auf die Filterkoeffizienten&nbsp; a0&nbsp; und&nbsp; a2&nbsp; verzichtet werden kann.
+
In the diagram it is already marked by the lighter border that the filter coefficients&nbsp; a0&nbsp; and&nbsp; a2&nbsp; can be omitted.
  
  
Line 18: Line 18:
  
  
 
+
Notes:  
 
+
*The exercise belongs to the chapter &nbsp; [[Theory_of_Stochastic_Signals/Digital_Filters|Digital Filters]]&nbsp; in this book.
 
+
*The HTML5/JavaScript applet&nbsp; [[Applets:Digital_Filters|"Digital Filters"]]&nbsp; illustrates the subject matter of this chapter.
''Hinweise:''
+
*For the subtasks&nbsp; '''(1)'''&nbsp; to&nbsp; '''(3)'''&nbsp; the following apply:
*Die Aufgabe gehört zum  Kapitel&nbsp; [[Theory_of_Stochastic_Signals/Digitale_Filter|Digitale Filter]]&nbsp; im vorliegenden Buch.
 
 
*Für die Teilaufgaben&nbsp; '''(1)'''&nbsp; bis&nbsp; '''(3)'''&nbsp; gelte:
 
 
:a1=0.5,b1=3.
 
:a1=0.5,b1=3.
  
  
===Fragebogen===
+
===Questions===
  
 
<quiz display=simple>
 
<quiz display=simple>
{Es gelte&nbsp; a1=0.5&nbsp; und&nbsp; b1=3.&nbsp; Berechnen Sie die Ausgangswerte&nbsp; yν&nbsp; zu den Zeitpunkten&nbsp; ν=0,&nbsp; ν=1&nbsp; und&nbsp; ν=2.
+
{Let&nbsp; a1=0.5&nbsp; and&nbsp; b1=3.&nbsp; Calculate the initial values&nbsp; yν&nbsp; at time points&nbsp; ν=0,&nbsp; ν=1&nbsp; and&nbsp; ν=2.
 
|type="{}"}
 
|type="{}"}
 
y0 =  { 0. }
 
y0 =  { 0. }
Line 38: Line 35:
  
  
{Wie lautet der Ausgangswert &nbsp;yν&nbsp; für &nbsp;ν2&nbsp; allgemein?&nbsp; Berechnen Sie die Werte &nbsp;y3, ... , y7&nbsp; und geben Sie zur Kontrolle &nbsp;y7&nbsp; ein.
+
{What is the initial value &nbsp;yν&nbsp; for &nbsp;ν2&nbsp; in general?&nbsp; Calculate the values &nbsp;y3, ... , y7&nbsp; and enter &nbsp;y7&nbsp; as a check.
 
|type="{}"}
 
|type="{}"}
 
y7 =  { -0.515--0.485 }
 
y7 =  { -0.515--0.485 }
  
  
{Wie viele Stützstellen&nbsp; (T0/T)&nbsp; stellen eine Periodendauer&nbsp; (T0)&nbsp; dar?
+
{How many grid points&nbsp; (T0/T)&nbsp; represent a period&nbsp; (T0)?&nbsp;
 
|type="{}"}
 
|type="{}"}
 
T0/T =  { 12 3% }
 
T0/T =  { 12 3% }
  
  
{Es gelte nun&nbsp; T = 1 \hspace{0.05cm} \rm &micro; s.&nbsp; Wie müssen die Koeffizienten&nbsp; a1&nbsp; und&nbsp; b1&nbsp; gewählt werden, damit eine&nbsp; 10 kHz&ndash;Sinusschwingung erzeugt wird?
+
{Now&nbsp; T = 1 \hspace{0.05cm} \rm &micro; s&nbsp; is valid.&nbsp; How must the coefficients&nbsp; a1&nbsp; and&nbsp; b1&nbsp; be selected so that a&nbsp; 10 kHz sine wave is generated?
 
|type="{}"}
 
|type="{}"}
 
a1 =  { 0.062 3% }
 
a1 =  { 0.062 3% }
Line 57: Line 54:
 
</quiz>
 
</quiz>
  
===Musterlösung===
+
===Solution===
 
{{ML-Kopf}}
 
{{ML-Kopf}}
'''(1)'''&nbsp; Die "1" am Eingang wirkt sich&nbsp;  (wegen&nbsp; a0=0)&nbsp; am Ausgang erst zum Zeitpunkt&nbsp; ν=1&nbsp; aus:
+
'''(1)'''&nbsp; The&nbsp; "1"&nbsp; at the input affects&nbsp;  (because of&nbsp; a0=0)&nbsp; at the output only at the time&nbsp; ν=1:&nbsp;  
 
:y0=0_,y1=0.5_.
 
:y0=0_,y1=0.5_.
  
*Bei&nbsp; ν=2&nbsp; wird auch der rekursive Teil des Filters wirksam:
+
*At&nbsp; ν=2,&nbsp; the recursive part of the filter also takes effect:
 
:y2=b1y1y0=3/20.866_.
 
:y2=b1y1y0=3/20.866_.
  
  
  
'''(2)'''&nbsp; Für&nbsp; ν2&nbsp; ist das Filter rein rekursiv:
+
'''(2)'''&nbsp; For&nbsp; ν2, &nbsp; the filter is purely recursive:
 
:yν=b1yν1yν2.
 
:yν=b1yν1yν2.
  
*Insbesondere erhält man
+
*In particular,&nbsp; one obtains
 
:y3=3y2y1=33/21/2=1;
 
:y3=3y2y1=33/21/2=1;
 
:y4=3y3y2=313/2=3/2;
 
:y4=3y3y2=313/2=3/2;
Line 79: Line 76:
  
  
'''(3)'''&nbsp; Durch Fortsetzung des rekursiven Algorithmuses der Teilaufgabe&nbsp; '''(2)'''&nbsp; erhält man für große&nbsp; ν&ndash;Werte: &nbsp;  
+
'''(3)'''&nbsp; By continuing the recursive algorithm of subtask&nbsp; '''(2)''',&nbsp; we obtain for large&nbsp; ν&ndash;values: &nbsp;  
 
:yν=yν12.
 
:yν=yν12.
*Daraus folgt&nbsp; T0/T=12_.&nbsp; Zum gleichen Ergebnis kommt man durch folgende Überlegungen:
+
*From this follows&nbsp; T0/T=12_.&nbsp; The same result is obtained by the following considerations:
 
:a1=sin(ω0T)=sin(2πT/T0)!=1/2=sin(π/6)2T/T0=1/6T0/T=12.
 
:a1=sin(ω0T)=sin(2πT/T0)!=1/2=sin(π/6)2T/T0=1/6T0/T=12.
  
*Die Überprüfung des Koeffizienten&nbsp; b1&nbsp; bestätigt die Rechnung:
+
*Checking the coefficient&nbsp; b1&nbsp; confirms the calculation:
:$$b_1  = 2 \cdot \cos \left( {{{\rm{\pi }}}/{6}} \right) = 2 \cdot c{\sqrt 3 }/{2} = \sqrt 3 .$$
+
:b1=2cos(π/6)=23/2=3.
  
  
  
'''(4)'''&nbsp; Aus &nbsp;$f_0 = 10 \hspace{0.05cm} \rm kHz$&nbsp; folgt &nbsp;T_0 = 100 \hspace{0.05cm} \rm &micro; s&nbsp; bzw. &nbsp;T0/T=100&nbsp;. Damit erhält man:
+
'''(4)'''&nbsp; From &nbsp;$f_0 = 10 \hspace{0.15cm} \rm kHz$&nbsp; follows &nbsp;T_0 = 100 \hspace{0.05cm} \rm &micro; s&nbsp; or &nbsp;T0/T=100&nbsp;. This gives:
 
:a1=sin(2πT/T0)=sin(3.6)0.062_,
 
:a1=sin(2πT/T0)=sin(3.6)0.062_,
 
:b1=2cos(2πT/T0)=2cos(3.6)1.996_.
 
:b1=2cos(2πT/T0)=2cos(3.6)1.996_.
Line 96: Line 93:
  
  
[[Category:Theory of Stochastic Signals: Exercises|^5.2 Digitale Filter^]]
+
[[Category:Theory of Stochastic Signals: Exercises|^5.2 Digital Filters^]]

Latest revision as of 19:53, 10 February 2022

Proposed filter structure

The diagram shows a second-order digital filter suitable for generating a discrete-time sinusoidal function on a digital signal processor  (DSP),  for example:

yν=sin(νTω0).
  • It is assumed that the input sequence  xν  describes a  (discrete-time)  Dirac delta function.  Thus,  all output values  yν  are simultaneously identical to zero for times  ν<0
  • The total of five filter coefficients result from the  Z-transform:
Z{sin(νTω0)}=zsin(ω0T)z22zcos(ω0T)+1.
  • Substituting this equation by a recursive second order filter  (M=2),  we obtain the following filter coefficients:
a0=0,a1=sin(ω0T),a2=0,b1=2cos(ω0T),b2=1.

In the diagram it is already marked by the lighter border that the filter coefficients  a0  and  a2  can be omitted.



Notes:

  • The exercise belongs to the chapter   Digital Filters  in this book.
  • The HTML5/JavaScript applet  "Digital Filters"  illustrates the subject matter of this chapter.
  • For the subtasks  (1)  to  (3)  the following apply:
a1=0.5,b1=3.


Questions

1

Let  a1=0.5  and  b1=3.  Calculate the initial values  yν  at time points  ν=0ν=1  and  ν=2.

y0 = 

y1 = 

y2 = 

2

What is the initial value  yν  for  ν2  in general?  Calculate the values  y3, ... , y7  and enter  y7  as a check.

y7 = 

3

How many grid points  (T0/T)  represent a period  (T0)

T0/T = 

4

Now  T = 1 \hspace{0.05cm} \rm µ s  is valid.  How must the coefficients  a_1  and  b_1  be selected so that a  \text{10 kHz} sine wave is generated?

a_1 \ = \

b_1 \ = \


Solution

(1)  The  "1"  at the input affects  (because of  a_0= 0)  at the output only at the time  \nu = 1

y_0 \hspace{0.15cm} \underline{= 0},\quad y_1 \hspace{0.15cm} \underline{ = 0.5}.
  • At  \nu = 2,  the recursive part of the filter also takes effect:
y_2 = b_1 \cdot y_1 - y_0 = {\sqrt 3 }/{2} \hspace{0.15cm} \underline{ \approx 0.866}.


(2)  For  \nu \ge 2,   the filter is purely recursive:

y_\nu = b_1 \cdot y_{\nu - 1} - y_{\nu - 2} .
  • In particular,  one obtains
y_3 = \sqrt 3 \cdot y_2 - y_1 = \sqrt 3 \cdot {\sqrt 3 }/{2} - {1}/{2} = 1;
y_4 = \sqrt 3 \cdot y_3 - y_2 = \sqrt 3 \cdot 1 - {\sqrt 3 }/{2} = {\sqrt 3 }/{2};
y_5 = \sqrt 3 \cdot y_4 - y_3 = \sqrt 3 \cdot {\sqrt 3 }/{2} - 1 = {1}/{2};
y_6 = \sqrt 3 \cdot y_5 - y_4 = \sqrt 3 \cdot {1}/{2} - {\sqrt 3 }/{2} = 0;
y_7 = \sqrt 3 \cdot y_6 - y_5 = \sqrt 3 \cdot 0 - {1}/{2} \hspace{0.15cm} \underline{= - 0.5}.


(3)  By continuing the recursive algorithm of subtask  (2),  we obtain for large  \nu–values:  

y_\nu = y_{\nu - 12} .
  • From this follows  T_0/T\hspace{0.15cm} \underline{= 12}.  The same result is obtained by the following considerations:
a_1 = \sin \left( {\omega _0 \cdot T} \right) = \sin \left( {2{\rm{\pi }}\cdot{T}/{T_0 }} \right)\mathop = \limits^! {1}/{2} = \sin \left( {{{\rm{\pi }}}/{6}} \right) \;\;{\rm \Rightarrow} \;\;{2T}/{T_0 } = {1}/{6}\quad \Rightarrow \;\;{T_0 }/{T} = 12.
  • Checking the coefficient  b_1  confirms the calculation:
b_1 = 2 \cdot \cos \left( {{{\rm{\pi }}}/{6}} \right) = 2 \cdot {\sqrt 3 }/{2} = \sqrt 3 .


(4)  From  f_0 = 10 \hspace{0.15cm} \rm kHz  follows  T_0 = 100 \hspace{0.05cm} \rm µ s  or  T_0/T = 100 . This gives:

a_1 = \sin \left( {2{\rm{\pi }}\cdot{T}/{T_0 }} \right) = \sin \left( {3.6^ \circ } \right) \hspace{0.15cm} \underline{\approx 0.062},
b_1 = 2 \cdot \cos \left( {2{\rm{\pi }}\cdot{T}/{T_0 }} \right) = 2 \cdot \cos \left( {3.6^ \circ } \right) \hspace{0.15cm} \underline{\approx 1.996}.