Question

Convolve the following two series: f=(0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0) g=(1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0). using the following methods: (a) Using Fast Convolution (Using...

Convolve the following two series: f=(0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0) g=(1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0). using the following methods: (a) Using Fast Convolution (Using MATLAB and show codes) (b) Using Fast Convolution with sufficient zeros added to avoid wrap-around effects (c) Using your convolution function. Plot all of the outputs in the time domain (Using MATLAB and show codes), using the same scale to enable better comparison. Comment on, and explain in detail, the differences between the results.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

MATLAB CODE

x=[0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0]; % Input Signal
h=[1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0]
%% Part a
Ly=length(x)+length(h)-1; %
Ly2=pow2(nextpow2(Ly)); % Find smallest power of 2 that is > Ly
X=fft(x, Ly2);       % Fast Fourier transform
H=fft(h, Ly2);   % Fast Fourier transform
Y=X.*H;     %
y=real(ifft(Y, Ly2)); % Inverse fast Fourier transform
disp('Convolution Result of Part a is :');
y=int16(y(1:1:Ly)) % Take just the first N elements

% %Part b
% part b will be same as part a except we will add 0 to the end of the array
% whose dimension is less than other to equalise the dimension
Lx=length(x);
Lh=length(h);
if(Lx>Lh)
Zero_M=zeros(1,Lx-Lh); % Will create an array of zeros to desired length
h=[h Zero_M]; % Appending to h as its length is less than x
else
Zero_M=zeros(1,Lh-Lx); % Will create an array of zeros to desired length
x=[x Zero_M]; % Appending to x as its length is less than h
end
Ly=length(x)+length(h)-1; %
Ly2=pow2(nextpow2(Ly)); % Find smallest power of 2 that is > Ly
X=fft(x, Ly2);       % Fast Fourier transform
H=fft(h, Ly2);   % Fast Fourier transform
Y=X.*H;     %
y=real(ifft(Y, Ly2)); % Inverse fast Fourier transform
disp('Convolution Result of Part b is :');
y=int16(y(1:1:Ly)) % Take just the first N elements
%% Part c
% Using Convolution function
disp('Convolution Result of Part c is : ');
conv(x,h)

x=[0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0];
h=[1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0]
%% Part a
Ly=length(x)+length(h)-1; %
Ly2=pow2(nextpow2(Ly)); % Find smallest power of 2 that is > Ly
X=fft(x, Ly2);       % Fast Fourier transform
H=fft(h, Ly2);   % Fast Fourier transform
Y=X.*H;     %
y=real(ifft(Y, Ly2)); % Inverse fast Fourier transform
disp('Convolution Result of Part a is :');
y=int16(y(1:1:Ly)) % Take just the first N elements

% %Part b
% part b will be same as part a except we will add 0 to the end of the array
% whose dimension is less than other to equalise the dimension
Lx=length(x);
Lh=length(h);
if(Lx>Lh)
Zero_M=zeros(1,Lx-Lh); % Will create an array of zeros to desired length
h=[h Zero_M]; % Appending to h as its length is less than x
else
Zero_M=zeros(1,Lh-Lx); % Will create an array of zeros to desired length
x=[x Zero_M]; % Appending to x as its length is less than h
end
Ly=length(x)+length(h)-1; %
Ly2=pow2(nextpow2(Ly)); % Find smallest power of 2 that is > Ly
X=fft(x, Ly2);       % Fast Fourier transform
H=fft(h, Ly2);   % Fast Fourier transform
Y=X.*H;     %
y=real(ifft(Y, Ly2)); % Inverse fast Fourier transform
disp('Convolution Result of Part b is :');
y=int16(y(1:1:Ly)) % Take just the first N elements
%% Part c
% Using Convolution function
disp('Convolution Result of Part c is : ');
conv(x,h)

RESULT:

Convolution Result of Part a is :
y =

Columns 1 through 26:

0 0 1 2 3 4 5 6 7 8 8 8 8 8 7 6 5 4 3 2 1 0 0 0 0 0

Columns 27 through 31:

0 0 0 0 0

Convolution Result of Part b is :
y =

Columns 1 through 26:

0 0 1 2 3 4 5 6 7 8 8 8 8 8 7 6 5 4 3 2 1 0 0 0 0 0

Columns 27 through 31:

0 0 0 0 0

Convolution Result of Part c is :
ans =

Columns 1 through 20:

0 0 1 2 3 4 5 6 7 8 8 8 8 8 7 6 5 4 3 2

Columns 21 through 31:

1 0 0 0 0 0 0 0 0 0 0

Add a comment
Know the answer?
Add Answer to:
Convolve the following two series: f=(0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0) g=(1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0). using the following methods: (a) Using Fast Convolution (Using...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • summatize the following info and break them into differeng key points. write them in yojr own...

    summatize the following info and break them into differeng key points. write them in yojr own words   apartus 6.1 Introduction—The design of a successful hot box appa- ratus is influenced by many factors. Before beginning the design of an apparatus meeting this standard, the designer shall review the discussion on the limitations and accuracy, Section 13, discussions of the energy flows in a hot box, Annex A2, the metering box wall loss flow, Annex A3, and flanking loss, Annex...

  • Develop a case study analysis in the following format Relevance of the case study to my...

    Develop a case study analysis in the following format Relevance of the case study to my work environment - application - learning impact CASE 4-1 Tambrands Overcoming Cultural Resistance Tampax, Tambrands's only product, is the best-selling tampon in their virginity if they use a tampon. When they go to the beach in the world, with 44 pencent of the global market North America and tiny bikinis, tampons arent their choike. Instead, hordes of women Europe account for 90 percent of...

  • summarizr the followung info and write them in your own words and break them into different...

    summarizr the followung info and write them in your own words and break them into different key points.   6.5 Metering Chamber: 6.5.1 The minimum size of the metering box is governed by the metering area required to obtain a representative test area for the specimen (see 7.2) and for maintenance of reasonable test accuracy. For example, for specimens incorporating air spaces or stud spaces, the metering area shall span an integral number of spaces (see 5.5). The depth of...

  • First, read the article on "The Delphi Method for Graduate Research." ------ Article is posted below...

    First, read the article on "The Delphi Method for Graduate Research." ------ Article is posted below Include each of the following in your answer (if applicable – explain in a paragraph) Research problem: what do you want to solve using Delphi? Sample: who will participate and why? (answer in 5 -10 sentences) Round one questionnaire: include 5 hypothetical questions you would like to ask Discuss: what are possible outcomes of the findings from your study? Hint: this is the conclusion....

  • How can we assess whether a project is a success or a failure? This case presents...

    How can we assess whether a project is a success or a failure? This case presents two phases of a large business transformation project involving the implementation of an ERP system with the aim of creating an integrated company. The case illustrates some of the challenges associated with integration. It also presents the obstacles facing companies that undertake projects involving large information technology projects. Bombardier and Its Environment Joseph-Armand Bombardier was 15 years old when he built his first snowmobile...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT