Menu

[Solved]Python Code Provided Need Help Answering Questions Based Python Code 1 Code Still Work Tak Q37098954

I have the python code provided all I need is help answeringthese questions based on the python code.

1.Why does the code still work if we take more terms(notes) thansamples of the signal?

2.How many samples did you need to take to make the differencebetween the truth and the reconstruction less than .1?

Here is the code just read the instructions on the code.

To Do Take more terms(increase the complexity of the model or admissable signals) What happcns If you take morc tems? Docs th

e15 15 -Reconstruction True Signal 10 0.5 0.0 -0.5 0.6 10 0.0 02 0.4 0.8 1.6763120889462054e+16 12.5 10.0 7.5 5.0 25 -2.5 -5.

Take more samples If we keep the number of terms fixed, does the reconstruction get better with more samples? In [17]: samp n

To Do Take more terms(increase the complexity of the model or admissable signals) What happcns If you take morc tems? Docs the answar” gat better or worse? Is there a imt on tre numiver o terrres yuu can take? . Does the code stil work you eceed this imit? In [16]nearp-20 nat isarp, ters-20) ple.plet (x ta, tzu. ะ (xpta 1,1abul-‘.True plt.xcatter(aamp, ta 1.ส.E(灬Pl ,e-‘r’ ] Y1gnal , ,e’:., plt.who( plt.catter (eap, iqs plt.ahou(1 ,ap [ 1.5822 971Le+00-2.937500002-01 .25301-01 2.325幺07了Be+00-1.22幺64638e+DC 1.26191917+00-1.570 8284-00 6.81839648-01 -5.12425171-+00 .05196661.-1.8213970-1 -4.40EC 60eLu+0〇1.09377913″+11-7.93116338..-14 1.36161517+00 3.09577913 141 e15 15 -Reconstruction True Signal 10 0.5 0.0 -0.5 0.6 10 0.0 02 0.4 0.8 1.6763120889462054e+16 12.5 10.0 7.5 5.0 25 -2.5 -5.0 0.0 0.4 10 0.2 0.6 0.8 Take more samples If we keep the number of terms fixed, does the reconstruction get better with more samples? In [17]: samp num-6000 ##change this samp-np. linspace ( 0 , 1, затр-num) A-lsq mat (samp, terms-10) data-noi3ef ( затр) out-np.līna1g.lstsq(A, data) ##Solve the least squares problem c i-out [0] print (c i) plt.plot (xpts, sum signs (c i,xpts),label-“Reconstruction’) plt.plot (xpts, truef (xpts), label-‘True Signal’,c’r’) plt.scatter (samp, noisef (samp),c’r) plt.legend () plt.show ) /opt/conda/lib/python3.6/site-packages/ipykernel_launcher.py:6: FutureWarning: ‘rcond parameter will change to the default of machine precision times ..max(M, N). where M and N are the input matrix dimensions. To use the future default and silence this warning we advise to pass rcond=None, to keep using the old, explicitly pass rcond-1 [ 0.06465814 0.04719624 1.08799421 0.17710132 0.06258099 -0.0804487 0.07352496 1.03314984 0.06176482 0.12515796] 15 10 -5 on _True Signal -15 0.0 0.2 04 0.6 0.8 1.0 Show transcribed image text To Do Take more terms(increase the complexity of the model or admissable signals) What happcns If you take morc tems? Docs the answar” gat better or worse? Is there a imt on tre numiver o terrres yuu can take? . Does the code stil work you eceed this imit? In [16]nearp-20 nat isarp, ters-20) ple.plet (x ta, tzu. ะ (xpta 1,1abul-‘.True plt.xcatter(aamp, ta 1.ส.E(灬Pl ,e-‘r’ ] Y1gnal , ,e’:., plt.who( plt.catter (eap, iqs plt.ahou(1 ,ap [ 1.5822 971Le+00-2.937500002-01 .25301-01 2.325幺07了Be+00-1.22幺64638e+DC 1.26191917+00-1.570 8284-00 6.81839648-01 -5.12425171-+00 .05196661.-1.8213970-1 -4.40EC 60eLu+0〇1.09377913″+11-7.93116338..-14 1.36161517+00 3.09577913 141
e15 15 -Reconstruction True Signal 10 0.5 0.0 -0.5 0.6 10 0.0 02 0.4 0.8 1.6763120889462054e+16 12.5 10.0 7.5 5.0 25 -2.5 -5.0 0.0 0.4 10 0.2 0.6 0.8
Take more samples If we keep the number of terms fixed, does the reconstruction get better with more samples? In [17]: samp num-6000 ##change this samp-np. linspace ( 0 , 1, затр-num) A-lsq mat (samp, terms-10) data-noi3ef ( затр) out-np.līna1g.lstsq(A, data) ##Solve the least squares problem c i-out [0] print (c i) plt.plot (xpts, sum signs (c i,xpts),label-“Reconstruction’) plt.plot (xpts, truef (xpts), label-‘True Signal’,c’r’) plt.scatter (samp, noisef (samp),c’r) plt.legend () plt.show ) /opt/conda/lib/python3.6/site-packages/ipykernel_launcher.py:6: FutureWarning: ‘rcond parameter will change to the default of machine precision times ..max(M, N). where M and N are the input matrix dimensions. To use the future default and silence this warning we advise to pass rcond=None, to keep using the old, explicitly pass rcond-1 [ 0.06465814 0.04719624 1.08799421 0.17710132 0.06258099 -0.0804487 0.07352496 1.03314984 0.06176482 0.12515796] 15 10 -5 on _True Signal -15 0.0 0.2 04 0.6 0.8 1.0

Expert Answer


Answer to I have the python code provided all I need is help answering these questions based on the python code. 1.Why does the co… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *