RSRC LVINLBVW0 `< :$aKLc "ӷDoY;Y ُ B~{+攫G:[-!LVINDcos.viLVINGaussian White Noise.vi78  @error&@@ Gaussian noise pattern @seed@ standard deviation @samplesPTH09Analysis 1siggen.llbGaussian White Noise.viQ  PP cL P d-`  P   cVP"@P@flg@oRt@eofudfP Tau, secp dfdP txdP oldP ext P   cZP"@P@flg@oRt@eofudfP Frequency, Hzp dfdP txdP oldP ext P   c\P"@P@flg@oRt@eofudfP Sweep Time, secp dfdP txdP oldP ext P c^P"@P@flg@oRt@eofudfPNumber of PointspdfdPtxdPoldPextJ P@@@P0!!! c 6P"@P@flg@oRt@eofudfNP@&P@@ t@@ yDamped Cosine Wave with Noise0x@"P@ @ dfd0P@"P@ @ txd0P@"P@ @ old0P@"P@ @ ext P   c\P"@P@flg@oRt@eofudfP % Random Noisep dfdP txdP oldP extb P         @P b P         @P  cjP"@P@flg@oRt@eofudf"P!Error, Undersampled Waveformx!dfdP!txdP!oldP!extj Pp@fP0@PP!!!!l@bP0   !!!$@P0!!!B@8PP cRP"@P@flg@oRt@eofudf P!stopx!dfdP!txdP!oldP!ext  ` y c c$ c` c! c40@&P@@ t@@ y!&P@@ t@@ y$P@@ t@ c@ y c@ t c@ Frequency, Hz@ Tau, sec c@ Sweep Time, sec c cD c@ % Random Noise@Number of Points@ Sweep Time, sec@ Frequency, Hz@ Sweep Time, sec@ % Random Noise @!stop cH c  c c c c c c c c c c c dP``` d: X  $ d$@. ^< ~@?@$@????^@$@??w Noise-Free.=HNOKC7) (17;;83,  $)-//-*% !$&''&$!##"!   !"#$&(*+-.345678;<=ABCDKLOPWX\]bcijlnw  Noise Added -7ANLIH?)!  -43;7561"  $ '0/+(!  ,.*(! ##$%%!"! ' "   !*"#$$&'()#*+-./01!345)6!78&:;!<%=>%?ABCDEGHIJKLNOPQ!RT$U!VWXY [\]"^_!ab cdefhi$jklnopqrsuvw  Time, sec Amplitudea]f@ !TD-@Y@@4D@P ,DPXxVP!]@@xz@)@@ 1 @p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DQRhUod$ZY_^ZY[]ÐX?MH  n g  * Z =9u  *r8 Zh.P% / I c } "CODEhF(vK8(`q7.0b71Oldest compatible LabVIEW.K`JpJ\JTpPPP@ Tau, sec@ Frequency, Hz@ Sweep Time, sec@Number of Points@ % Random NoiseN@@&P@@ t@@ yDamped Cosine Wave with Noise"@!Error, Undersampled Waveform @!stopNI.LV.ALL.VILastSavedTarget0DfltNI.LV.ALL.goodSyntaxTargets&@0DfltThis VI allows the user to graph an exponentially damped cosine wave, which is given as: y(t) = exp(-t/T)*cos(2*pi*v*t) Where the parameter T is the decay time of the exponential decay, and the parameter v is the frequency of the cosine wave. The user may adjust the above parameters and the sweep time, the number of data points graphed and the % random noise to be added to the simulation. The data is displayed as an x,y graph. As default parameters, the values tau = 2 sec, v = 1 Hz, sweep time = 10 sec, number of points = 200 and % random noise = 7% Ranges for Tau and frequency are 0 to infinity One major problem in displaying sine waves is "aliasing". Consult your text on pp. 309 and 466 for a graphical portrayal and discussion of this phenomenon. According to Nyquist, one must sample a sinusoidal function at least two times during its highest frequency oscillation. Alternatively, the sampling frequency of the waveform must be at least two times higher than the highest frequency in the waveform. This vi calculates the sampling frequncy as the number of points divided by the sweep time. This frequency is compared with the frequency of the cosine wave set on the front panel. If the later is greater than the former, all is well. If the opposite occurs the error light is turned on. The vi is enclosed in a while loop so that the program runs continuosly until the stop button is depresed. Developed by JBC 3-31-03%.2f%.2f%.2f%.2f%.0f%.1f%.1f%.0f%.2f%.0f@G;=@GH!! (xDTHPDJ88pw~@ Tau, sec"@ Frequency, Hz @ Sweep Time, sec&@Number of Points^N@@&P@@ t@@ yDamped Cosine Wave with Noise2"@!Error, Undersampled Waveform @ y! @ % Random Noise@ 6&@@ Gaussian noise pattern@@ y|p8  @error&@@ Gaussian noise pattern @seed@ standard deviation @samples @!stop0*P0!!!0$@P0!!!0$P@@ t@ @ t @samples$@ standard deviation @seed @error@@ t6&P@@ t@@ y<0@&P@@ t@@ ylU$$DDh(D88XXX(hP(((h|hXX$$XPX0T8lh TTau, secY Frequency, Hz[>K>KSweep Time, sec\ssNumber of PointsHD$JWX Z% Random NoiseH4JHg4Q R%4 6 VK0  RdA0 7  R0  P@ 6VSSR .w.w*{.w*{ xp 2<Vl9KKKKl9ddl9, <,<  h  .w.w*{.w*{a;XiCK 1;Xi   8 <.w.w*{.w*{, @ p X1;Xi ,&'D'' |01X;Xi 0X("V1;XiCK @P8d4 B ćK0  @ 2 @p5p5l9@ 2 o6o6k:0X|1&$;Xi 8 2 ȇKK, ,l<8  2L /ЇKK8 hB 8  2 P_؇KK8 hB , !nhh8 hLB , 08 hLB , 0@8  2 KK,X@(88 2L KK8hB ,d8x0 J"&  L ""#`##"d&%8h"BT8hB, $ 48h BDO@4"]f%Lnf KDO`4"0a"xhfat K8hB8v *>KK<O $8hB<O #8h<B8h B<O 0"8hB<Ox( , , |4 C\(K \(<(<(<(<(<YYY0X \8h\B 1L : 0J0J/K.L-MTau is the decay parameter for the exponential decay. The units are in seconds. Tau is the time for the intensity of the decay function to decrease to 1/e of its original value. L :L !-0J0J/K.L-ML : Q]0J0J/K.L-MFrequency, in Hz is the oscillation frequency of the cosine wave. Caution: do not select a frequency higher than the Nyquist frequency or you will get strange results due to undersampling of the waveform. See the text on p. 285pZThis is the total time displayed on the graph. It is the maximum value on the time axis. L : 0J0J/K.L-ML :L 0J0J/K.L-MThe number of data points displayed. The time values are scaled so that the first time point is 0 seconds and the last is the value of the sweep time. Thus the time increments are tfinal/(N-1). Sets the amount of random noise added as a per cent of full scale. Since the maximum value of the cosine function is 1, the random noise is scaled by the percent value times 100. When this light is lit, the waveform is undersampled. Note that the waveform can be severely distorted, for sampling frequencies that are less than 10x the frequency of the cosine. This is an x,y type graph. Two items are plotted: (a) the function without noise (solid line). and (b) the function with added random noise (open circles). Note the peculiarities of forming a multiple x,y graph. See p. 230-231 of the text book. p^u4  < %R $ $P$#,4 B"  K0 o"! p>g0 C" .>g4 6e?tRK@ :"J!tf?f?]H@ :"L!tv/v/o6@ :"K!tg>n7g>0 2(aHfI 0 2-ad 4 3^t K0 2- 4 3^]$lK4 6rK %l$$%0 2( 0 " D>g4 $":K0 " `ym)`;Xi =lTd0&< O'(44 K&4K8!h&BR<!  v&KXJ0#XX!&<#pp4x'# &<#'x4pp#lThe stop botton, when used with the while loop allows the user to halt the program in a reproducible state. (Depess this button to halt the program. VBDHPDcos.viLVINGaussian White Noise.viFdPTH0RBDHPA(J8R)xDrR,#OOdP0#DOH0#@N$'t4# BK0$@N$#p! 44$ B3K0%@N$0h4% Bh#K0&@N$ ,p4& B%K0'@N$|4@FfV`4' B0KT( Nh%l_?.`z:&lX(,($p# 0(&(0($)P`X( (@( l0(&@*_og (( (@ , ( 4(NhHT2D 4(Nh5  (!T%("0(@N$x"(h$4(2 ($($ P(dx4(Nh6  4(Nh5@! 4(Nh,;4 . ("(H!4(/Nh3$SD.j(4(0194N?C9j( ( 4(0p2C*N4H/j( ( <%L4(0/9*C4>/j( (04(Nh&Bx. (dx4( Nh) 8XrKL)J\h*4HK`"'0*@N$*"4* t3.*Hh4*K  3* $K+ +@ \ 4+K  7#K, ,@H x4,NhI7D ,, ,"( , @ , ,,# 6, , d4,K  8ĈK- -@ P#4-/Nh!8Kk+\i-"8-N )|9Ih90- 3 !tA4-K  :*;2ȈK. .@ 0 h ,.( ; !.  .@( 0 4. dK  ..  4.K  <QbŸK/ /@ 4/NhA .4/K P=?PGЈK0d 0@ 0 40 B #ԈK41/Nh"B/j1<410>(=*2$j41K ?!*%؈K2 2@X2 2$420(@2=7j2< 2@<2 d2DP420H(2-j2 2@2P\0AHC42 B<%W4z܈K43 BTwK44 41< .44"  BM_VhQc 04 3 0A,4N$D)4 4@N$@\44NhI=  44Nh$C$ .444Nht1 .4<844NhT t045 `KTd\ 4@P045 @Ql tp 4@\H 4@h,4Hh4P4044Nh? .44"`M6? : 4"( T 4 @ t4Tt,4#@L 4Tt44,K .4 T045xOT d\4 4@Ht4H44"`pJ6?:44Jt . 4"(0 4 @P40P,4#@N40P44/Nh(Hh,g44Nh<  .844Nh\V$v-p44 045<PVf^4 4@<045<<RV#f^4P 4@< F045<tSn$vr 4@<,p 4@<p,4P440 !t[f`i 4@|`@04;U 84:Nh-X` 4@\h4H4@04;HT 444Nh?0P.04;5 4 4@,4@444Nh`>P.444NhHP.4@044 BK5D55Dd 5F 5t5d 5\<F5td45/Nh m)Vq450Xc]g450NXSg5(45Nh; 450NXSg5mThe probram is encolsed in a while loop so that it will run continuously until the stop botton is depressed. 5 @#!5!#45 B1K6d 6F6x#6$$% 6& $46/Nh 4Jj+j6" P%6#L6%L46!Lx 6!#6!T",# 6  #6!T 6"( #l460 p|Ze_j6! 46" 0_hc$L 6 )<%)6",46/Nh".N ,x"#6#L%L460"` 4I># 6&T" 6 #$x#,6 H 0 6"` "%L46" -_hc'6# 6 @'t#l6 P46Nh 9 6#6$,6#@.!460 #Q[Vi 6 p!$ 6 p0'@$,6  6 p ,' 6% 6"` ,%%L,6 tPx#460"` 4I># 6'#460 "LQ[Vi460#s}xq460 }q<6  T0d!6#L,6 !#l460 p%8PZUj460 p$8+PZUj46Nh$9< 6%,6#!,#l460' s}xq@6P()DE6)46 J( ;DvK07 3( )D,7N$(\(1 7@N$)<()7)",47Nh) 8 7aD8;Di 1;Di ,7If the acual sample frequency is greater than the minimum sampling frequency, then this function is false and the indicator light remains off. If the actual sample frequency is less than the minimum sampling frerquency, then the function is true and the error light is light. L7 :( %+0J0J/K.L-M7wThe frequency of the operator set cosine wave is multiplied by 2 to determine the lowest possible sampling frerquency. 7yThe actual sampling frequency is determined by the number of data points chosen divided by the total sweep time chosen. d7MOne is subtracted from the total data points for calcultion of the interval. |7fThe array containing the random noise is added to the the array contining the values of the function. 7sIn order to plot two waveforms on the same graph we must follow the procedure given in your text book on page 231. h7RThe time (X array) and the amplitude (Y array) are bundled together for plotting. L7 : 2>0J0J/K.L-Md7PThe time increments used in the for loop are = sweep time/(no. of data pts.-1). D7-This is the for loop structure that calculates the various values of the dependent variable (amplitude) as a function of a sequence of values of the independent variable, which is time. To the value is added a user selected value of random noise. Note the scaling factors applied. To simulate noise, we use the simple random number generator (dice) that generates random numbers between 1 and 0. Note that real-world randomness seldom follows this pattern. Instead the noise is more likely to follow "the bell shaped curve", i.e. is Gaussian in nature. 7GQcQG\7@7887\SH|HHH7Hc7 XXY7This is where the calculations are performed. (1) The ith time is calculated as i*dt. dt is the time increment calculated from the total time an the total number of data points. (2) the noise-free function is calculated. 77x_kkx7x`kkxL7 ,ggA A > EV El  V U > >7)<6VFF7'tcL7# cVVLL70>/>U7^ J ^]J]]]L7 \N\ : N  S C C K K7PlP:2$2:7,rr7\  pL7 \H\H:^H^7~DhFM^JJWLO-r7 QcQHC9CH7 H!aa!>H/7- "" -`7!D)pDD0NNMM7NhaD;Di 1;Di 7M;Di 1;Di 1;Di 87 2( *C8KK,9(pEH+(E89h(B9F49 CFd1d@K$:FFGdGHp:GdD:1NhF,E@d` (H* :FdG0F4:3FdEG@tPH| :Fd\FF:G4:3Fd IPt`X| :FdH Gd4:3FdGEKdUtPl :FdG4:3FdH A@dKtEl:Hp4:3FdFPFUd`tZl:F :Fd ,G,:I.H,J:|VV  : 8J<:G,: Hp%L%8: 2 1@uKK8<hB8<h B<:%11< 0211< : $ 0 0< cmR;Di =))DDtDDDE$M<<l<$P !- 4%`'|0 8$\h0<NhO<N,<CPP4QL <@N$NN0<%CN <O(0<$CNT <@N$QNO(<<pC0<@N$Q'OvQ<C<OO(L< NO(h0)OL< N$"` p Fd<|<OFd) p"`0<\hO(N<4< BOgvvKl=Q)< ,0't#\|,\@  4=NhOQ!=Q ( KUUAoHH(Q8>*>*>Q8>K?    ̀ π 0TahomaTahomaTahoma010RSRC LVINLBVW0  4 RSIDHLVSR\BDPWpLIviCPTMDSTMDFDSLIdsVICDversDLDRFPTD$CPMp8VITSLSTRG `ICON`Y? 4U?4a?l@@x_@XR@d A8|y Ah~A4B~BhBC vCCzD8D[ DQ!E<#Ed|$E%F(j&Ftx}'FU(G Lp)GXm*GD+H0̒,Hb-H {.I,a/Ih0Iv1J(P2Jt0}3J@j4K ]5Kx؃6K̃7L8{8Lp:L4R;M$ o=MpWMgM̼rM_M䪠"M_N N($PwUwvʈʴ@8UDcos.vi