digital signal eegr

User Generated

nmvm92tne

Engineering

Description

all info in file I posted ...................

Unformatted Attachment Preview

Project 1 Morgan State University Department of Electrical and Computer Engineering EEGR 451 – DSP - Spring 2019 Exercise 1: Basic digital signals (a) Write a MATLAB program to generate and display (using the stem function) the basic signals listed under part (c) below, first with 2 time unit delay and then with 3 time units advance. Hard copies of sample MATLAB codes for the different basic signals are given with this project. (b) Write a MATLAB function [x, t] = sin_NU(f0, fs, T) to generate a sine signal. A sample code is given for you. The output parameters x and t are the signal and time vectors, respectively. The input parameters are f0 (signal frequency in Hz), fs (sampling frequency in Hz), T (signal duration in sec.). (c) Test your sin_NU function with the input parameter values of sampling frequency =1000 Hz, f0=10 Hz and T=0.5, and display the result using the plot function. List of basic digital signals to generate: - Dirac (Unit Response) - Unit step (Heaviside step) - Sign - Rectangle - Sine - Sine cardinal Exercise 2: Audio aliasing To illustrate the aliasing phenomenon, let’s perform two simple experiments allowing us to “hear” it. Using the sin_NU function of Exercise 1 above: (a) Generate two 1 kHz sine signals (2 seconds duration), first signal at 20 kHz sample frequency and second signal at 1.5 kHz sample frequency; (b) On the same graph, use the plot function to display the two signals versus t in the range 0 < t < 5 msec.; (c) Listen to the two signals one after another using the function soundsc(x, fs); and (d) Give your interpretation of this listening. Exercise 3: Quantization Quantization is done by replacing each value of an analog signal x(t) by the value of the nearest quantization level. To exemplify this operation, let’s simulate an unipolar ADC (Analog to Digital Converter) having the technical specifications: R = 10 Volts (full-scale range) and B = 3 (number of bits). (a) Write a MATLAB function y = adc_NU(x, R, B) where x and y are vectors containing the input signal and the quantized signal, respectively; (b) Test your function with an input ramp signal ranging from -5 to 15 Volts (1 volt per step); and (c) On the same graph, use the plot and stem functions to display the input signal and quantized signal, respectively.
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

https://drive.google.com/drive/folders/1yXa6hQJQUY...

% ADC_NU function test
R = 10;
B = 3;
x = -5:15;
y = adc_NU(x,R,B);
t = 0:length(x)-1;
figure(11)
plot(t,x,t,y)
plot(t,x,'g-*','LineWidth',2.2)
hold on
stem(t,y,'filled','LineWidth',2.2)
hold off
title('Ramp function unipolar quantization')
xlabel('Time in sec')
ylabel('Signal magnitude in volts')
axis([-0.1,20.1,-5.1,15.1])

Published with MATLAB® R2016a


T = 2; %parameters
f0 = 1000;
fs1 = 20000;
fs2 = 1500;
[x1, t1] = sin_NU(fs1,f0,T);
[x2, t2] = sin_NU(fs2,f0,T);
figure;
plot(t1,x1,t2,x2,'LineWidth',3.0),
axis([0, 0.005, -1.1, 1.1])
legend('High Frequency','Low Frequency')
xlabel('Time')
ylabel('Signals')
title('Audio aliasing');
soundsc(x1,fs1)
% % %%%
soundsc(x2,fs2)

Published with MATLAB® R2016a


%DIRAC FUNCTION
x...


Anonymous
I was stuck on this subject and a friend recommended Studypool. I'm so glad I checked it out!

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags