Question

In: Electrical Engineering

By using MATLAB 1. Divide a speech signal or music signal into frames of size N...

By using MATLAB

1. Divide a speech signal or music signal into frames of size N = 64.
2. Compute the N?point DFT of each frame.
3. Save only first L = 20 DFT coefficients.
4. Reconstruct the frame from these L coefficients. (Do not disturb the symmetry
of DFT during inverse DFT computation. X[k] = X[N ?k] for real signals, N = 64
here. Pad zeros for missing DFT coefficients.)
5. Comment on the quality of reconstructed and the original speech signal.
6. What is the effective data compression ratio? Note that DFT coefficients may be
complex valued!
7. Repeat the above experiment for L = 10 and L = 5.

Solutions

Expert Solution

##----------------------------matlab code-------------------------------------------------##

load chirp.mat; % sound signal
sound(y, Fs); %-------- number of sample sampling frequencey
plot(y(1:13056));
N=64;
L=20 %----------- number of coefficient you want to kept
number_frame=floor(length(y)/N); % number of frame
sample_sig=y(1:N); %-------------- frame with 64 sample
reconst_sig=[];
for i=0:number_frame-2
each_frame=y((i*N)+1:N*(i+1)) ; %--------------each frame
each_frame=each_frame' ; % transpose of value
fft_frame=abs(fft(each_frame,N)); % fft of each frame
fft_val=fft_frame(1:L); % first 20 point
new_sig=[fft_val,zeros(1,N-L)]; % rest value with zero padding
reconst = real(ifft(new_sig,N)); % inverse fourier transform
reconst_sig=[reconst_sig,reconst]; % reconstructed sppech.
end
hold on
plot(reconst_sig);
sound(reconst_sig, Fs);

##----------------Here the blue signal is the original signal and the red signal reconstructed signal.

##-----for L=20

##----------- for L=10;

##-----for L=5

##------------------------L=40

##-----------By reducing the the number of coefficient reconstructed signal is degraded.


Related Solutions

USING MATLAB In signal processing applications, the Hankel matrix is useful. The elements of a (N...
USING MATLAB In signal processing applications, the Hankel matrix is useful. The elements of a (N × N) Hankel matrix are given by h?? =0   ?+?−1>? =?+?−1 otherwise Write a script that takes as input from the user an integer, n. Your code should accept input ≥1 and <10. The user should be repeatedly prompted until acceptable input is entered. Next, create n Hankel matrices for N=1,2,...,n. That is, if the user enters 4, you’ll generate 1×1, 2×2, 3×3, and...
Consider the finite duration signal x(n) = (0.9)ncos(0.1πn) for 0 ≤ n ≤ 31. Using MATLAB:...
Consider the finite duration signal x(n) = (0.9)ncos(0.1πn) for 0 ≤ n ≤ 31. Using MATLAB: a.) Plot the signal b.) Plot the real part of the DFT of x(n), the imaginary part of the DFT of x(n) and the DCT of x(n). All transforms are length N = 32.
Signals and systems Consider the following discrete signal x[n] = sin(π n/32) (u[n]-u[n-33]) a) Using MATLAB...
Signals and systems Consider the following discrete signal x[n] = sin(π n/32) (u[n]-u[n-33]) a) Using MATLAB only, Find the DFT using FFT algorithm, b) Plot the signal x[n], spectrum |X(ω)|^2 , and phase of X(ω). Hint: use L=512 for FFT.
Using Matlab Simulink, find Fourier transform of the following signal; ?(?) = 2 + ∑ 1...
Using Matlab Simulink, find Fourier transform of the following signal; ?(?) = 2 + ∑ 1 ? sin (20???) 4 ?=1 . Set simulation stop time = 20 seconds, sample time = (1/1024) seconds, buffer size =1024, and frequency range in Hz for the vector scope is −100 ≤ ? ≤ 100
In matlab using a RC low pass filter Create a 1 Hz input signal (with amplitude...
In matlab using a RC low pass filter Create a 1 Hz input signal (with amplitude of one). Corrupt the input signal with signals greater than or equal to 100 Hz and/or random noise. Use randn(length(v_in,1)) to test filter
Realize signal processing systems described by the difference equation: ?1(?)=1/2 [?(?)+?(?−1)] and ?2(?)=1/2 [?(?)−?(?−1)] using Matlab....
Realize signal processing systems described by the difference equation: ?1(?)=1/2 [?(?)+?(?−1)] and ?2(?)=1/2 [?(?)−?(?−1)] using Matlab. Assuming same input signal x(n)=sin(ωn) for various values of ω ={0,p/6 ,3p/2, 1.9p/2} applied to both systems find the following: a. Obtain stem plots and codes of y1(n) and y2(n) in each . b. Critically analyze y1(n) and y2(n) in terms of type of filter, maximum gain and cut off frequency. (Hint : The system can be tested by computing frequency response of the...
Write a Matlab program to create specialized plot animation with 16 frames by using fast Fourier...
Write a Matlab program to create specialized plot animation with 16 frames by using fast Fourier transforms of complex matrices
Develop a general computer program using MATLAB for the analysis of plane (2D) frames. You can...
Develop a general computer program using MATLAB for the analysis of plane (2D) frames. You can use Chapter 6 as a reference. The program should be able to: a. Analyze a frame subjected to different load types, such as joint load, member load, and support displacement; b. Analyze frames with different boundary conditions: pin, roller, and fixed support; c. Generate the results including joint displacements, member axial, shear and moment forces, and reactions
Make a code in matlab to know the determinant of a matrix n x n, using...
Make a code in matlab to know the determinant of a matrix n x n, using the sarrus rule.
using matlab, compute and plot y [n] = x [n]* h [n], where a. x [n]...
using matlab, compute and plot y [n] = x [n]* h [n], where a. x [n] = h [n] = a^n (0 <=n <=40) & a = 0.5 b. x [n] = cos [n]; h [n] = u [n]; n = 0:4:360 c. x [n] = sin [n] ; h [n] = a^n; n:4:360; a = 0.9
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT