[Solved] CS 6810/7810: Wavelets and Wavelet Algorithms Assignment 5 Multiresolution Analysis with HWT and CDF(2, 4)

$25

File Name: CS_6810_7810__Wavelets_and_Wavelet_Algorithms_Assignment_5_Multiresolution_Analysis_with_HWT_and_CDF_2__4_.zip
File Size: 998.52 KB

SKU: [Solved] CS 6810/7810: Wavelets and Wavelet Algorithms Assignment 5 Multiresolution Analysis with HWT and CDF(2, 4) Category: Tag:
5/5 - (1 vote)

Learning Objectives1. CDF(2, 4)2. Multiresolution Analysis with HWT and CDF(2, 4)IntroductionIn this assignment, you will implement forward and inverse CDF(2, 4) and then compare it with HWT in the multireso-lution analysis of a synthetic signal.Problem 1Implement a class CDF24:java with the following two static methods:public static void ordDWTForNumIters(double[] signal, int num_iters) {}public static void ordInvDWTForNumIters(double[] signal, int num_iters) {}The rst method computes the CDF(2, 4) transform of the signal for a given number of iterations. The secondmethod inverses the CDF(2, 4) transform of the signal for a given number of iterations. Both methods destructivelymodify their rst arguments. Below are a few test methods implementing two examples from lecture 5.public class WaveletAlgos_S17_HW05 {static void displaySignal(double[] sig){for(double d: sig)System.out.println(d);System.out.println();}// example on slides 30-31 in lecture 5static void test01() {double[] signal = {1, 2, 3, 4};CDF24.ordDWTForNumIters(signal, 1);displaySignal(signal);CDF24.ordInvDWTForNumIters(signal, 1);displaySignal(signal);}// example on slides 45-48 in lecture 5: 1 iterationstatic void test02() {double[] signal = {1, 2, 3, 4, 5, 6, 7, 8};CDF24.ordDWTForNumIters(signal, 1);displaySignal(signal);CDF24.ordInvDWTForNumIters(signal, 1);displaySignal(signal);}// example on slides 45-48 in lecture 5: 2 iterations1static void test03() {double[] signal = {1, 2, 3, 4, 5, 6, 7, 8};CDF24.ordDWTForNumIters(signal, 2);displaySignal(signal);CDF24.ordInvDWTForNumIters(signal, 2);displaySignal(signal);}}Here is the output of test01() without rounding.public static void main(String[] args) { test01(); }2.31078903454114844.760278777324325-4.440892098500626E-16-1.4142135623730950.99999999999999991.99999999999999962.99999999999999873.9999999999999987Here is the output of test02() without rounding.public static void main(String[] args) { test02(); }2.31078903454114845.1392161592873377.96764328403352810.038195644853694-4.440892098500626E-16-8.881784197001252E-16-8.881784197001252E-16-2.828427124746191.00000000000000041.99999999999999962.99999999999999873.99999999999999874.9999999999999985.9999999999999996.9999999999999987.999999999999997Here is the output of test03() without rounding.public static void main(String[] args) { test03(); }5.90192378864668212.0980762113533140.3660254037844384-3.8301270189221923-4.440892098500626E-16-8.881784197001252E-16-8.881784197001252E-16-2.828427124746191.01.99999999999999982.9999999999999983.9999999999999974.99999999999999645.9999999999999976.9999999999999977.9999999999999982Problem 2Consider the curve given in equation (1). The graph of this curve on [0; 511] is plotted in the left image of Figure 1.f(x) =8><>:sin(4x) if 0  x < 141 + sin(4x) if 14  x < 34sin(4x) if 34  x  1(1)Figure 1: Curve w/o noise (left); curve with random noise addedI used the following JAVA code to generate the values for the graph in Figure 1.public class Function {public Function() {}public double v(double x) { return 0; }public double[] generateRangeInterval(double[] domain_values) {return null;}}public class Ripples_F_ex_4_4_p34 extends Function {public Ripples_F_ex_4_4_p34() {}@Overridepublic double v(double t) {if ( 0 <= t && t < 0.25 ) {return Math.sin(4*Math.PI*t);}else if ( 0.25 <= t && t < 0.75 ) {return 1 + Math.sin(4*Math.PI*t);}else if ( 0.75 <= t && t <= 1 ) {return Math.sin(4*Math.PI*t);}else {throw new IllegalArgumentException(t == + t);}}}Let us infuse some small random noise into this curve. The noisy curve is shown in the right image of Figure 1. Iused this method to add noise.3public static void addRandomNoiseToSignal(double[] signal) {for(int i = 0; i < signal.length; i++) {signal[i] += Math.random()/2.0;}}Use your implementation of HWT and CDF(2, 4) to do the multiresolution analysis of f(x) with random noise in termsof D8, D7, D6, and S6. Figure 2 shows the D6 components of HWT and CDF(2, 4). Figure 3 shows the S6 componentsof both transforms.Figure 2: D6 HWT (left); D6 CDF(2, 4) (right)Figure 3: S6 HWT (left); S6 CDF(2, 4) (right)What To SubmitSubmit your CDF24.java or CDF24.py via Canvas. Also, submit the png images of your plots of S6, D6, D7, and D8components of the multiresolution analysis for both transforms. You do not have to submit your JAVA/Python sourcefor multiresolution analysis. The plots are sucient. I used Octave to generate my plots. If you do not feel comfortablewith Octave, you can use your favorite plotting software (Matlab, matplotlib, R, etc.) to generate your graphs and savethem as pngs. Your graphs, of course, may be slightly di erent due to the random nature of the added noise. Name your4graphs as S6_HWT.png, S6_CDF.png, D6_HWT.png, D6_CDF.png, etc.Happy Hacking and Plotting!5

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CS 6810/7810: Wavelets and Wavelet Algorithms Assignment 5 Multiresolution Analysis with HWT and CDF(2, 4)[Solved] CS 6810/7810: Wavelets and Wavelet Algorithms Assignment 5 Multiresolution Analysis with HWT and CDF(2, 4)
$25