Akshit DSP
Akshit DSP
Akshit DSP
ICT 391
u = double(t >= 0); % u(t) = 0 for t < 0 and u(t) = 1 for t >= 0
delta = zeros(size(t));
figure;
xlabel('t');
ylabel('u(t)');
grid on;
stem(t, delta, 'LineWidth', 2); % Use stem for discrete impulse approximation
title('Impulse Function (Delta Function Approximation)');
xlabel('t');
ylabel('\delta(t)');
axis([-5 5 0 120]);
grid on;
xlabel('t');
ylabel('r(t)');
axis([-5 5 -1 6]);
grid on;
Output
Program 2
y = conv(x, h);
figure;
subplot(2,1,1);
title('Signal x[n]');
xlabel('n');
ylabel('x[n]');
grid on;
subplot(2,1,2);
title('Signal h[n]');
xlabel('n');
ylabel('h[n]');
grid on;
figure;
xlabel('n');
ylabel('y[n]');
grid on;
Output
Program 3
X_omega = zeros(size(omega));
for k = 1:length(omega)
end
figure;
% Magnitude plot
subplot(2,1,1);
title('Magnitude of DTFT');
xlabel('\omega (rad/sample)');
ylabel('|X(\omega)|');
grid on;
% Phase plot
subplot(2,1,2);
xlabel('\omega (rad/sample)');
grid on;
Output
Program 4
N = length(x);
for k = 1:N
end
figure;
% Magnitude plot
subplot(2,1,1);
title('Magnitude of DFT');
xlabel('k');
ylabel('|X[k]|');
grid on;
% Phase plot
subplot(2,1,2);
xlabel('k');
grid on;
Output
Program 5
X_fft = fft(x);
figure;
subplot(2,1,1);
xlabel('k');
ylabel('|X[k]|');
grid on;
subplot(2,1,2);
xlabel('k');
grid on;
Output
Program 6
N = length(x);
for n = 1:N
for m = 1:N
end
end
figure;
subplot(3,1,1);
stem(0:N-1, x, 'filled');
title('Sequence x[n]');
xlabel('n');
ylabel('x[n]');
subplot(3,1,2);
stem(0:N-1, h, 'filled');
xlabel('n');
ylabel('h[n]');
subplot(3,1,3);
xlabel('n');
ylabel('y[n]');
grid on;
Output
Program With cconv Function
% Define two input sequences x[n] and h[n]
% Plot the input sequences and their circular convolution result using cconv
figure;
subplot(3,1,1);
stem(0:length(x)-1, x, 'filled');
title('Sequence x[n]');
xlabel('n');
ylabel('x[n]');
subplot(3,1,2);
stem(0:length(h)-1, h, 'filled');
xlabel('n');
ylabel('h[n]');
subplot(3,1,3);
xlabel('n');
ylabel('y[n]');
grid on;
Output
Program 7
N = length(x);
X_z = zeros(size(Z));
for n = 1:N
end
figure;
subplot(1,2,1);
ylabel('Im(z)');
zlabel('|X(z)|');
colorbar;
subplot(1,2,2);
xlabel('Re(z)');
ylabel('Im(z)');
colorbar;
Output
Program With ztrans function
% Define the sequence x[n] symbolically
syms n z;
X_z = 0;
for n = 1:length(x)
end
disp(X_z);
figure;
zplane(b, a);
N = 4; % Filter order
Wn = fc / (fs / 2);
figure;
subplot(2,1,1);
xlabel('Frequency (Hz)');
ylabel('Magnitude');
grid on;
subplot(2,1,2);
xlabel('Frequency (Hz)');
ylabel('Phase (radians)');
grid on;
Output
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: