

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
learning pattern recognition through assignment conceptual understanding
Typology: Summaries
1 / 3
This page cannot be seen from the preview
Don't miss anything!


The first program demonstrates KL-Divergence between two probability distributions using Python libraries such as NumPy, SciPy, and Matplotlib. 1. Two normal distributions are defined: - P(x): Standard Normal Distribution (mean=0, std=1) - Q(x): Shifted and wider Normal Distribution (mean=2, std=1.5) 2. KL-Divergence Formula Used: D(P||Q) = Σ P(x) * log(P(x)/Q(x)) 3. The function kl_divergence(p, q) computes the divergence while avoiding division-by-zero errors using NumPy's conditional operations. 4. Results: KL Divergence P||Q = 50.7780 KL Divergence Q||P = 110.8657 This shows that KL-Divergence is not symmetric. D(P||Q) ≠ D(Q||P). The graphical plot visually compares both distributions and displays divergence values on the figure.
The second program records or loads a voice sample and computes its FFT using a manually implemented Recursive Cooley-Tukey Algorithm. 1. The algorithm splits the signal into even and odd indexed samples. 2. It recursively computes FFT on smaller parts. 3. Combines results using butterfly operations: X[k] = Even[k] + Twiddle * Odd[k] X[k+N/2] = Even[k] - Twiddle * Odd[k] Operation Counting: For N = 4096 samples: Complex Multiplications = 24576 Complex Additions = 49152 The program also plots: - Time Domain signal - Frequency Domain (Magnitude Spectrum) This demonstrates computational efficiency of FFT (O(N log N)) compared to naive DFT (O(N²)).