answersLogoWhite

0

%the program is developed my Mohendra Roy

%Bioelectronics division, Department of ECE, Tezpur Central University, India,

a=input('Please Give The RANGE : ');

k=-a:+1:+a;

x=input('The input the x: ')

h=input('The input the h: ')

% x=[1 .5 .25]

% h=[1 .5 .25]

f=fliplr(h);

l1=length(x);

l2=length(h);

l3=l1+l2-1;

l4=l2-1;

y=zeros(1,l3);

for p=1:1:l3

p1=p+l4;

h2=zeros(1,l3);

h2([p:p1])=f;

l5=length(h2);

h1=zeros(1,l5);

h1([l2:l3])=x

c1=h1.*h2

c2=0;

for i=1:1:l3

c2=c2+c1([i]);

end

sum=c2

y([p])=sum

end

% temp1=length(x);

% temp2=length(h);

t=length(y);

t2=(t-1)/2;

v=-t2:1:t2;

subplot(3,1,1),stem(k,x,'*');

subplot(3,1,2),stem(k,h,'g*');

subplot(3,1,3),stem(v,y,'r*');

n=input('The lower limit of X axis is: ')

m=input('The Upper limit of X axis is: ')

o=input('The lower limit of Y axis is: ')

p=input('The Upper limit of Y axis is: ')

subplot(3,1,1),stem(k,x,'*');axis([n m o p]);grid on

subplot(3,1,2),stem(k,h,'g*');axis([n m o p]);grid on

subplot(3,1,3),stem(v,y,'r*');axis([n m o p]);grid on

% subplot(3,1,1);stem(x);

% subplot(3,1,2);stem(h);

% subplot(3,1,3);stem(y);

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

Code for circular convolution matlab?

Please check the help files of the matlab circular convolution . Matlab already has a readymade function for it.


How do you modulate in matlab without using matlab tools?

You would have to write your own code for a modulation (Matlab has a convolution function not in the tools), otherwise you can use its built in function in the signal processing toolbox.


Convolution in matlab using for loop?

There are a lot of convolution functions in matlab, mostly in the signal processing toolbox, so it depends on what you want to do. Matlab has extensive help files available online.


Matlab code for finding linear convolution using circular convolution?

To find linear convolution using circular convolution in MATLAB, you can use the cconv function, which computes the circular convolution of two sequences. To obtain the linear convolution, you need to pad one of the sequences with zeros to the length of the sum of the lengths of both sequences minus one. Here's a simple example: x = [1, 2, 3]; % First input sequence h = [4, 5]; % Second input sequence N = length(x) + length(h) - 1; % Length for linear convolution y = cconv(x, [h, zeros(1, N-length(h))], N); % Circular convolution This will give you the linear convolution result of x and h.


How do you implement awgn in MATLAB without using awgn function?

no way... use awgn function in matlab


Gram schmidt matlab code for orthonormalizing set of vectors?

gram schmidt matlab code


Program to demostrate the convolution theorm in matlab?

To demonstrate the convolution theorem in MATLAB, you can use the following example code. First, define two signals, such as x = [1, 2, 3] and h = [0.5, 1]. Compute their convolution using the conv function, and then verify the theorem by transforming both signals into the frequency domain using the Fast Fourier Transform (FFT), multiplying the results, and then applying the inverse FFT. Here's a simple implementation: x = [1, 2, 3]; h = [0.5, 1]; conv_result = conv(x, h); % Convolution in time domain % Frequency domain approach X = fft(x); H = fft(h, length(x) + length(h) - 1); % Zero-padding for proper multiplication Y = X .* H; % Multiply in frequency domain freq_conv_result = ifft(Y); % Inverse FFT to get back to time domain disp([conv_result; freq_conv_result']); % Display results This code illustrates that the convolution of the two signals in the time domain equals the inverse FFT of their product in the frequency domain.


Matlab code of convolutional coding and viterbi algorithm?

matlab code for convolutional coding and BCH coding


Difference between linear and circular convolution?

circular convolution is used for periodic and finite signals while linear convolution is used for aperiodic and infinite signals. In linear convolution we convolved one signal with another signal where as in circular convolution the same convolution is done but in circular pattern ,depending upon the samples of the signal


Which is the function of matlab?

matlab stands for matrix laboratory.. the function of matlab to create different types of signal and observe them .and their are so many different functions of matlab like, simulink fuzzy logic,simply arithmetic ,GUI etc


What is the matlab code to generate comb function?

In MATLAB, you can generate the comb function (also known as the comb or binomial coefficient function) using the nchoosek function. Here is a simple code snippet to create a comb function: function C = comb(n, k) C = nchoosek(n, k); end You can call this function by passing the values of n and k to get the binomial coefficient ( C(n, k) ). For example, comb(5, 2) would return 10.


What is the difference between continuous and discrete convolution?

A convolution is a function defined on two functions f(.) and g(.). If the domains of these functions are continuous so that the convolution can be defined using an integral then the convolution is said to be continuous. If, on the other hand, the domaisn of the functions are discrete then the convolution would be defined as a sum and would be said to be discrete. For more information please see the wikipedia article about convolutions.