# DSP using Matlab Book in practice example 2.1

Source: Internet
Author: User

First the code, then the result diagram.

A

`n = [ -5:5];x=2*impseq ( -2,-5,5)-Impseq (4,-5,5); set (GCF, ' color ', [1,1,1])                  % change coordinates peripheral background color stem (n,x); title (' Sequence In problem 2.1a '); Xlabel (' n '); Ylabel (' x (n) '); Grid on;`

B

`n = [0:20]; X1 = N. * (Stepseq (0,0,20)-Stepseq (10,0,20)); x2 = ten * exp ( -0.3* (N-10)). * (Stepseq (10,0,20)-Stepseq (20,0,20)); x = x1 + X2;set (GCF, ' Color ', [1,1,1])                  % change coordinates peripheral background color stem (n,x); title (' Sequence in Problem 2.1b ') Xlabel (' n '); Ylabel (' X (n) ') ; grid on;`

C

`n = [0:50]; x = cos (0.04*pi*n) +0.2*randn (Size (n)), set (GCF, ' color ', [1,1,1])                  % change coordinates peripheral background color stem (n,x); title (' Sequence in problem 2.1c ') Xlabel (' n ');  Ylabel (' x (n) '); Grid on;`

D

`Percent of a percent X (n) = {..., 5,4,3,2,1,5,4,3,2,1,5,4,3,2,1,...}; -10<n<9%%                       *n = [ -10:9]; x = [5,4,3,2,1];xtilde = X ' * ones (1,4); Xtilde = (Xtilde (:)) ';%subplot (2,2,4); set (GCF, ' Color ', ' white '); stem (N,xtilde); Title (' Sequence in Problem 2.1d ') Xlabel (' n '); Ylabel (' Xtilde (n) '); grid on;`

DSP using Matlab Book in practice example 2.1

Related Keywords:

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

## A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

• #### Sales Support

1 on 1 presale consultation

• #### After-Sales Support

24/7 Technical Support 6 Free Tickets per Quarter Faster Response

• Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.