Matlab Code for Convolution is this right?

Click For Summary
SUMMARY

The discussion focuses on the convolution of a discrete-time system with a unit response defined as h[n] = (0.2(1.3)^n)u[n] and an input signal x[n] = sin(n*pi/2)u[n]. The MATLAB code provided uses the conv function to compute the convolution, with the user noting that the unit step function u[n] is effectively 1 for n >= 0. The user acknowledges that truncating the convolution at n = 30 may lead to invalid results at the high end due to the insertion of zeros in the convolution process. To improve accuracy, extending the length of the signals is recommended.

PREREQUISITES
  • Understanding of discrete-time systems and unit step functions
  • Familiarity with MATLAB programming and syntax
  • Knowledge of convolution operations in signal processing
  • Basic understanding of signal truncation effects
NEXT STEPS
  • Explore MATLAB's conv function in detail
  • Learn about the implications of signal truncation in convolution
  • Study the properties of discrete-time systems and their responses
  • Investigate methods for extending signal lengths in MATLAB
USEFUL FOR

Students and professionals in signal processing, MATLAB users, and anyone involved in analyzing discrete-time systems and convolution operations.

user101
Messages
205
Reaction score
0

Homework Statement



A DT system has the unit response h[n] = (0.2(1.3)^n)u[n]. You then input x[n] = sin(n*pi/2)u[n]. Find the convolution.

Homework Equations



None.

The Attempt at a Solution



>> n = 0:30;
>> h = 0.2*(1.3).^n;
>> x = sin(n*pi/2);
>> s = conv(h,x);

I left out u[n] because we know that u[n] = 1 whenever n >= 0 and 0 when n < 0. So, if I am correct, it is just multiplying the input by 1, if n >=0.

This should be right, just wanted to verify.
 
Last edited:
Physics news on Phys.org
Looks good to me. Just remember that the far end of the convolution sum will not be valid because you are truncating it at 30. What the algorthm does is insert zeros at the front and back of the signals. This is all right on the low end because the signals are zero anyway below zero, but it will cause invalid results at the high end. This can be fixed by simply making the signals longer than you need.
 
oh it didnt specify how far n should go, so i made it randoml from 0 to 30.
 

Similar threads

  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
7K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K