Question

In: Electrical Engineering

Use and provide Matlab for the following: Generate the discrete-time signal x[n] = 4 cos (2pi....

Use and provide Matlab for the following: Generate the discrete-time signal x[n] = 4 cos (2pi. 10. nT5) + 2cos(2pi. 100. nT5) + 3cos(2pi 200. nT's), with Ts0.001 sec. Display the signal in both time and frequency-domain. Assume that the 100 Hz component of x [n] is your desired signal while the other two components are noise. Design a suitable filter to extract the desired (i.e. 100 Hz) signal. Display the filter's response. Display the output signal in the frequency-domain. Display the time-domain input and output signals in the same plot.

Solutions

Expert Solution

Matlab Code:

clc;clear;
Ts = 0.0001;
Fs = 1/Ts;
nT = 0:Ts:1;
x = 4*cos(2*pi*10*nT) + 2*cos(2*pi*100*nT) + 3*cos(2*pi*200*nT);
figure;
subplot(2,1,1)
plot(nT,x)
grid on
xlabel 'Time'
ylabel 'Amplitude'
title 'Time Domain Input Signal'
N = length(x);
del_f = (-Fs/2):(Fs/(N-1)):(Fs/2);
X = fftshift(fft(x)/N);
subplot(2,1,2)
plot(del_f,abs(X))
grid on;
xlabel 'Freq'
ylabel 'Amplitude'
title 'Frequency Domain Output Signal'
[b,a] =butter(3, (110/10000));
y_filt_low = filter(b,a,x);
[b,a] =butter(3, (90/10000), 'high')
y_filt = filter(b,a,y_filt_low);
figure;
subplot(2,1,1)
plot(nT,y_filt)
grid on;
xlabel 'Amplitude'
ylabel 'Time'
title 'Output Signal in Time Domain'
N = length(y_filt);
del_f = (-Fs/2):(Fs/(N-1)):(Fs/2);
X = fftshift(fft(y_filt)/N);
subplot(2,1,2)
plot(del_f,abs(X))
grid on;
xlabel 'Freq'
ylabel 'Amplitude'
title 'Output Signal in Frequecny Domain'

%%-----------------------------------------------------------------


Related Solutions

Consider a discrete-time periodic signal x [ n ]   =   cos ( 0 . 7 πn ) (1)...
Consider a discrete-time periodic signal x [ n ]   =   cos ( 0 . 7 πn ) (1) Determine the fundamental period of x[n]. (2) Suppose x[n] is obtained by sampling the continuous-time signal  x ( t )   =   cos   ( πt ), by letting the sampling period to be T s =   0 . 7 and considering the sample values at each n. Is the Nyquist sampling conditions satisfied in this case? Explain and relate this to the answer given before. (3) Under that conditions would...
Consider the following discrete-time system: y[n] = 100 x[n] cos(0.45πn + 0.5π) (a) Determine if the...
Consider the following discrete-time system: y[n] = 100 x[n] cos(0.45πn + 0.5π) (a) Determine if the system is linear, time-invariant, causal and stable. Justify your answers. (b) Find the impulse response h[n] for the system and sketch the waveform. (c) Draw the system block diagram using adder, multiplier and delay elements.
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.
1. A length-10 discrete-time signal x[n] is defined by the values { 6, 1, 1, 6,...
1. A length-10 discrete-time signal x[n] is defined by the values { 6, 1, 1, 6, 1, 1, 6, 1, 1, 0 }. After taking the 10-pt DFT, X[k], determine the DC value, i.e., X[0]. 2. Suppose that the N-point DFT of the signal x[n]x[n] is X[k]. A new signal y[n] is formed by adding a constant: y[n]=x[n]+1 for n=0,1,2,…,N−1n=0,1,2,…,N−1 The N-point DFT of Y[k] is:
Write a matlab code for given task Use your ‘sin’ or ‘cos’ function to generate a...
Write a matlab code for given task Use your ‘sin’ or ‘cos’ function to generate a sinusoid wave having two components as f1 = 3kHz and f2 = 5kHz and then sample it with fs = 10kHz. Calculate its fft with zero frequency component in the middle. Plot it on a properly scaled w-axis. Specify if there is aliasing or not? If there is aliasing specify which component is casing the aliasing
Use MATLAB to find the 8 point DFT of x(n) = cos(2πmn/8) (m=3) for 0 ≤...
Use MATLAB to find the 8 point DFT of x(n) = cos(2πmn/8) (m=3) for 0 ≤ n ≤ 7. Plot both x(n) and its DFT and explain your results. The "dct" and "fft" functions in MATLAB may be useful. Please post MATLAB code.
Prove that (cos x + isin x) n = cos nx + isin nx. (Hint: Use...
Prove that (cos x + isin x) n = cos nx + isin nx. (Hint: Use Euler’s formula).
Using Matlab, write code to generate Three signal components We will use a sum of sinusoids,...
Using Matlab, write code to generate Three signal components We will use a sum of sinusoids, all of which are sampled at 10 kHz. Signal 1 should contain a sum of sinusoids with frequencies at 25Hz, 40Hz and 75Hz. Signal 2 should contain a sum of sinusoids with frequencies at 600Hz, 730Hz, and 800Hz. Signal 3 should contain a sum of sinusoids with frequencies at 3500Hz, 4000Hz, and 4200Hz. Choose a variety of amplitudes and phase shifts for the sinusoids....
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.
4. For a signal x(n)=sin(4*pi*n/5) defined for n=0to7, evaluate the Fast Fourier Transform using signal flow...
4. For a signal x(n)=sin(4*pi*n/5) defined for n=0to7, evaluate the Fast Fourier Transform using signal flow graph. (Use decimation in Time Algorithm).                                                
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT