I am Parton R. I am a Signal Processing Assignment Expert at matlabassignmentexperts.com. I hold a Master's in Matlab, from The University, of Edinburgh, UK. I have been helping students with their assignments for the past 6 years. I solve assignments related to Signal Processing.
Visit matlabassignmentexperts.com or email info@matlabassignmentexperts.com.
You can also call on +1 678 648 4277 for any assistance with Signal Processing assignments.
Hybridoma Technology ( Production , Purification , and Application )
Online Signal Processing Assignment Help
1. For any Assignment related queries, Call us at : - +1 678 648 4277
You can mail us at : - info@matlabassignmentexperts.com or
reach us at : - https://www.matlabassignmentexperts.com/
matlabassignmentexperts.com
2. PROBLEM SET
Problem 1: Given a waveform x(t) with a pdf of the form
p(x) = λe−λx x > 0
= 0 otherwise
calculate (a) the mean µx, and (b) the variance
Problem 2: White noise is passed through an ideal low-pass filter with a cut-off
frequency of ωc. Find the autocorrelation function of the filtered noise.
Problem 3: A Mini-project: Deblurring the Hubble Telescope Images
As you know, the scientific world was shocked by the poor quality of the initial
images from the Hubble Space Telescope after its launch April 24, 1990. After it
went into orbit, it became clear that something was wrong. While the pictures
were clearer than those of ground-based telescopes, they were blurry, and not the
Read the Class Handout: Introduction to Two-Dimensional/Image
Processing be fore attempting this mini-project.
matlabassignmentexperts.com
3. pristine images promised.
The telescope’s primary mirror had been polished with a ”spherical aberration”
flaw. It was just slightly the wrong shape, causing the light that reflected from the
center of the mirror to focus in a different place than the light reflected from the
edge. The tiny flaw about 1/50th the thickness of a sheet of paper, was enough to
seriously degrade the images.
While the problem was well understood, the hardware fix was time consuming and
very expensive. The rest is history, we now look in awe at the images from Hubble.
In this mini-project we are going to use signal processing techniques to deblur
some Hubble images. We provide you with two blurred images, your task is to
sharpen them and restore the full fidelity.
• An gray-scale image can be thought of as a two-dimensional function f(x,y),
where f is the intensity of the image at point x,y in the image.
• A RGB (red-green-blue) colored image can be thought of having three separate
com ponent images (a red fr(x,y), a green fg(x,y), and a blue fb(x,y)) image.
• A digital image is made up of pixels - in our case our images will be 512 × 512
pixels.
matlabassignmentexperts.com
4. • Many optical distortions, such as blurring, can be thought of as a linear filtering
op eration, with the difference that 1) the functions being filtered are functions of
space (not time), and 2) are two-dimensional.
• An image processing filter has a two-dimensional impulse response, known as the
point spread function h(x,y), reflects how an impulsive point at the center of the
source image is “spread” out in space by the filter.
• The operation of a linear image processing filter is that of 2-D convolution of the
2-D input image with the 2-D point-spread function (see the class handout).
• The two-dimensional Fourier transform is defined (see the class handout), and
anal ogous with 1-D signal processing, the filtering may be done my multiplication
in the Fourier domain, that is
matlabassignmentexperts.com
5. Y (j u, j v) = F (j u, j v)H(j u, j v)
where F (j u, j v) = F2 {f(x,y)}, Y (j u, j v) = F2 {y(x,y)}, H(j u, j v) = F2 {h(x,y)} is the
image filter’s 2-D frequency response, and u, and v are spatial frequencies with units
of radians/unit length.
Let’s assume that the aberrant mirror in the Hubble telescope has caused the true
image f(x,y) to be blurred by convolution with a known point-spread function h(x,y),
so that the image we are given is g(x,y). The process of recovering f(x,y) is known as
deconvolution, or inverse filtering. In one-dimensional temporal linear processing,
we might do the following:
By definition, the inverse filter has a frequency response of 1/H(j ω) so that F (j ω) is
re covered at its output. While it sounds easy, the process can be fraught with
difficulties, for example if H(s) has zeros on the imaginary axis the gain of the
inverse filter will go to infinity at that frequency. Also inverse filters often tend to
amplify any high frequency noise.
matlabassignmentexperts.com
6. In the two-dimensional case, if we know the point-spread function h(x,y) that
blurred the image, we can construct the inverse filter 1/H(j u, j v) and use it to
restore the original.
Details of the MATLAB Tools You Might Need:
• There are two blurred Hubble images to deal with. These are contained in the
MAT LAB files blurredimage1.mat, and blurredimage2.mat. Each image is a 512 ×
512 RGB colored image. When loaded into MATLAB the image will be named
blurred in each case (deal with them one at a time). You can view the image with
load blurredimage1;
image(blurred);
• MATLAB has 2-D fft functions fft2() and ifft2(). Don’t forget that you will have
to work on all three color planes in the image.
• The mirror design engineers have told us that the distortion was equivalent to
convolu tion with a Gaussian kernel such as produced by MATLAB’s image
processing toolbox function fspecial():
matlabassignmentexperts.com
7. hsize=25;
sigma = 3;
h = fspecial(’gaussian’, hsize, sigma);
You might want to use mesh(h) to take a look at it.
If you don’t have access to the Image Processing toolbox, here is how you can
construct the 2-D kernel:
siz = (hsize-1)/2;
[x,y] = meshgrid(-siz(2):siz(2),-siz(1):siz(1));
arg = -(x.*x + y.*y)/(2*sigma*sigma);
h = exp(arg);
sumh = sum(h(:));
h = h/sumh;
Note that the sum of elements is set to unity.
• When you have processed an RGB image and want to display it, the display
function image(myRGBimage) requires that all values be real, positive, and in the
range 0 to 1.
matlabassignmentexperts.com
8. Do not use the Image Processing Toolbox to solve this problem. We want to see
each step you took in solving the problem. Submit the listing of your MATLAB script
as a .m file, and upload your deblurred images before 1pm on the due date.
Problem 4:
You have probably realized by now that I just love the sound of my own voice! I used
Windows Sound Recorder on my PC to make a recording of me saying “good
morning” so that I can play it to myself each morning when I wake up. It just makes
my day...
Now, here’s the problem. Windows Sound Recorder has a button “Add Echo”, -
which surprisingly adds an echo to a recorded sound. Unfortunately I clicked on this
button before I saved the “.wav” file, and the result is that I sound as if I am
speaking from inside a tin can! I hate that, and I want you to help restore my voice
to its natural beauty.
Your job is to analyze the recorded file to find out exactly how Microsoft added
the echo, and then to remove it.
On the class MIT Server is a Microsoft “.wav” file PS9Prob2.wav that
contains me saying “good morning” to myself. Download the file and load it into
MATLAB using the wavread() function. If your computer has speakers (or
headphones) you can play the sound using the sound() or soundsc() functions. Use
help audio to see the sound handling functions in MATLAB.
matlabassignmentexperts.com
9. (a) Given a function f(t) with autocorrelation φff (τ ), find an expression for the
autocorre lation function φgg(τ ) of a waveform g(t) where
g(t) = f(t) + αf(t − Δ)
is f(t) contaminated by an echo with delay Δ and amplitude α. Express your
answer in terms of φff (τ).
(b) In the case of a discrete-time signal contaminated by an echo, let
gn = fn + αfn−m.
where m is the echo delay. Express the echo generation as a linear filtering
operation and derive the the transfer function H(z).
Use MATLAB to analyze the .wav file, using the results of part(a), to estimate the
parameters α and m that Microsoft Windows Sound Recorder used to create
the echo in the .wav file.
(c) Using your results from (b), design a digital filter that will eliminate the echo
contami nation from the .wav file. Derive the transfer function, and the
difference equation.
matlabassignmentexperts.com
10. (d) Use MATLAB to apply your inverse filter to the sound file and show (hopefully)
that it has removed the echo.
Document your process so that we can understand exactly what you did.
matlabassignmentexperts.com
11. SOLUTION SET
Solution1:
Solution2:
Input f is a white noise with flat spectrum and hence we assume that Φff(jω) = 1.
The output can be computed from:
matlabassignmentexperts.com
12. Solution3:
The inverse filter for this high-precision problem can be implemented as the
exact inverse of the input filter. We will revisit this problem in the 2nd quiz where
additive noise of quantization imposes some modification to the inverse filter.
Here is the code that we used.
-Note that “h” kernel needs to be zero padded such that that image and h DFT
have the same size. This ensures that their corresponding DFT matrix elements,
correspond to the same (u,v) value and we can multiply them element-wise.
- Note the color scaling at the end. All the color channels are scaled with the same
scale, such that relative RGB pattern is not altered.
matlabassignmentexperts.com
13. clear all,close all,clc
%% Read in the image
load(’blurredimage2.mat’,’blurred’)
figure,subplot(2,1,1),image(blurred), axis image
title(’Double Precision Input (blurred) Image’)
%% Determine the size of the image supplied
pad = 24;
imsize = size(blurred);
xsize = imsize(1) + pad;ysize = imsize(2) + pad;
% Take fft of image
fftblur = fft2(blurred,xsize,ysize);
%--------------------------------------------
%% Design the inverse filter
% Use a gaussian kernel from the image processing toolbox hsize=25;sigma = 3;
h = fspecial(’gaussian’, hsize, sigma);
ffth = fft2(h,xsize,ysize);
% Create the inverse filter - this is just the simple form:
fftinvh = 1./ffth;
% figure
% mesh(fftshift(abs(fftinvh)))
% title(’Inverse Filter Magnitude’)
%-----------------------------------------------
matlabassignmentexperts.com
14. %% Filter the image
fftdeblur = zeros(xsize,ysize,3);
for i=1:3 fftdeblur(:,:,i) =
fftinvh.*fftblur(:,:,i);
end
%% Inverse fft and Color Intensity Scaling
deblurred = abs(ifft2(fftdeblur));
% Normalize the pixel intensity for the whole image
% to set all values in the range 0 -- 1 (already all are positive)
maxpix = max(max(max(max(deblurred))),1);
deblurred = deblurred/maxpix;
% Show the image
subplot(2,1,2),image(deblurred), axis image
title(’Double Precision Output (deblurred) Image’)
matlabassignmentexperts.com
19. Solution 4:
(a) The autocorrelation of the contaminated signal is
φgg(τ) = E{g(t)g(t+ τ)}
= E{(f(t)+αf(t −Δ))(f(t + τ)+αf(t + τ −Δ))}
= E{(f(t)f(t + τ)}+ E {α2 f(t −Δ)f(t + τ −Δ) } +E{αf(t)f(t + τ
−Δ)}+ E{αf(t+ τ)f(t −Δ)}
and recognizing that φff(τ)does not depend on the time origin,
φgg(τ)=(1+α2)φff(τ)+αφff(τ −Δ)+αφff(τ +Δ)
(b) With the MATLAB code
[f,fs,Nbits] = wavread(’PS9Prob4.wav’);
L = length(f);
figure(1), plot(-(L-1):L-1, xcorr(f,f))
the following plot was annotated using the cursor tip.
matlabassignmentexperts.com
21. We assume that φff(0) >> φff(2τ),φff(τ) and then from (a) peaks on the graph
correspond to:
(1 +α2)φff(0) ≈ 57.98 αφff(0) ≈ 15.59
or
α2 − 3.72α +1 = 0
so that α ≈ 0.29. Actually α = 0.3 and we will use α = 0.3 value. Similarly, from the
autocorrelation function m = 1200.
(c) Recognize that Eq. (2) is a filter with H(z) = 1+αz−Δ . Then the inverse filter
H′(z) = 1/H(z) to remove the echo is
which is an IIR filter with a difference equation
fn = −αfn−m + gn.
(d) Below is the complete MATLAB code to implement the filter and filter the data:
[f,fs,Nbits] = wavread(’PS9Prob4.wav’);
L = length(f);
matlabassignmentexperts.com
22. figure(1), plot(-(L-1):L-1, xcorr(f,f))
title(’Autocorrelation of input data’)
xlabel(’shift’)
ylabel(’phi’)
% Look at the autocorrelation function
wavplay(f,fs)
% Determine that the
delay is 1200 and alpha=0.3 delay = 1200; alpha = 0.3;
% Recursive filter:
% Set up the denominator:
a1 = zeros(1,1201); a1(1) = 1; a1(1201) = alpha;
y = filter(1, a1, f);
figure(2), plot(-(L-1):L-1, xcorr(y,y))
title(’Autocorrelation of processed data (IIR filter)’)
xlabel(’shift’)
ylabel(’phi’)
%
wavplay(f1,fs)
which produced the following output autocorrelation plot
matlabassignmentexperts.com
23. Note that the echo components have been eliminated.
matlabassignmentexperts.com