answersLogoWhite

0

clc

clear all

close all

a = [1 2 3 4];

b = [6 7 8 9 10];

f=length(a);

g=length(b);

h=(f+g-1);

i=[a,zeros(1,(h-f))];

j=[b,zeros(1,(h-g))];

y1 = fft(i);

y2 = fft(j);

z = y1.*y2;

c = ifft(z);

subplot(2,2,1); plot(a)

title('a')

subplot(2,2,2); plot(b)

title('b')

subplot(2,2,3); plot(c)

title('Convolution of a,b')

User Avatar

Wiki User

13y ago

What else can I help you with?

Continue Learning about Math & Arithmetic

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.


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.


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.


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.


Does matlab talk?

Yes, it is possible to make matlab talk in Windows using a simple program that can be downloaded here: http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=15890&objectType=FILE If you are using a mac, or unix then there may be other ways to make matlab talk, but the basic code will be quite similar. Have fun. Ed

Related Questions

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.


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.


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.


What is a sentence using convolution?

gyiuhkjhkj


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.


Is it possible to run matlab program in web browser?

Yes, it is possible to run MATLAB programs in a web browser using MATLAB Online, a cloud-based version of MATLAB provided by MathWorks. MATLAB Online allows users to create, edit, and run MATLAB scripts directly from a web browser without needing to install the software locally. Additionally, some features like MATLAB Web Apps enable users to deploy MATLAB applications that can be accessed and run in a browser.


Does matlab talk?

Yes, it is possible to make matlab talk in Windows using a simple program that can be downloaded here: http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=15890&objectType=FILE If you are using a mac, or unix then there may be other ways to make matlab talk, but the basic code will be quite similar. Have fun. Ed


How to generate multi component sine wave signal by using matlab program?

Generating Sine and Cosine Signals (Use updated lab)


How do we start beginner matlab program?

To start a beginner MATLAB program, first, open MATLAB and create a new script by clicking on "New Script" in the Home tab. Write your code in the editor window, using basic syntax such as variable assignments, loops, and functions. Save your script with a .m extension, and run it by clicking the "Run" button or typing the script name in the Command Window. Familiarize yourself with built-in functions and the MATLAB documentation to enhance your programming skills.


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.


How do you make graph from an equation in Matlab?

Initially, the equation can be directly realized using Matlab source code. Then various inputs can be applied to it. These values can easily be plotted on a graph using plot or stem command in Matlab.


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

no way... use awgn function in matlab