Home
Login
Register
Search
Home
Convolution in Matlab Without Using Conv(x h) - File Exchange
Convolution in Matlab Without Using Conv(x h) - File Exchange
April 3, 2018 | Author: Anu Ranjan | Category:
Matlab
,
Computer Programming
,
Mathematics
,
Physics & Mathematics
,
Technology
DOWNLOAD
Share
Report this link
Comments
Description
Search: File Exchange Create Account File Exchange Answers Newsgroup Link Exchange Blogs Trendy Cody Contest MathWorks.com Log In h=input('Enter the second sequence: ').1:length(x)-j).h) MATLAB release MATLAB 7.j+1:length(x2))). lx=length(x).. u2=input('Enter the upper limit: ').3125 3. end y=zeros(1. l2=input('Enter the lower limit: ').2. Comment only 15 Mar 2014 Sharifa Yasheen I excuted Priya's written program but got error saying X must be same length as Y and even in subplot(2.stem(x1. if lx>lh x2=[x2 zeros(1. u1=input('Enter the upper limit: '). for i=1:length(y) if i<=length(x) y(i)=sum(x(1. l1=input('Enter the lower limit: ').h) 3.4 (R14SP2) Please login to tag files. y(i)=sum(x(1. x1=l1:1:u1.lx-lh)].*x2(1.CONVOLUTION IN MATLAB WITHOUT USING conv(x. u=u1+u2. else x=[x zeros(1.m A GENERALAZED CONVOLUTION COMPUTING CODE IN MATLAB WITHOUT USING MATLAB BUILTIN FUNCTION conv(x.length(x)-i+1:length(x)).1:i)). Comment only Code covered by the BSD License Highlights from CONVOLUTION IN MATLAB WITHOUT USING conv(x..I runned the aghil vinayak program got output but t is 1*6 matrix but ishould be 3*3 Comment only 18 May 2015 Dhrubajyoti Das Good 24 Sep 2014 Muhammad Azeem function y=my_conv(x.h) View all files . else j=i-length(x). % enter in brackets enter h=[ ] File ID: #23402 Version: 1. l=l1+l2. Tags for This File communications Save Cancel Please login to add a comment or rating.lx+lh-1). end end figure stem(y). n=l:1:u. Please help me out where am going wrong Comment only 15 Mar 2014 Zulqadar Hassan good 23 Feb 2014 Priya clc clear all close all x=input('Enter the first sequence: ').h) convolution. h1=l2:1:u2. lh=length(h).0 Watch this File File Information Description A GENERALAZED CONVOLUTION COMPUTING CODE IN MATLAB WITHOUT USING MATLAB BUILTIN FUNCTION conv(x.35 KB enter x=[ ]. x=fliplr(x).lh-lx)].0. s=numel(n). Comments and Ratings (25) 08 Aug 2015 s priyanka I am not understand this concept can anybody xplain me i am using X as 3*3 matrix and h as 3*3 matrix.3 | 16 ratings Rate this file by imran shezad 23 Mar 2009 47 Downloads (last 30 days) File Size: 1.*x2(1.1).h) x2=h.x). e.ylabel('y(n)'). X = input('Enter x: '). end end end i=i+1. title('Convolution without conv function'). end else % now when all of the T is non zero which means 100% overlap in else overlap would start to decrease between T and H % T is basically X t(1)= 0. % summing for all H(j)*t(j) and putting it at y(1) or y (2) or Y(i) in first iteration % i.stem(n.e. k=k+1. end disp(y). for j = 1:LenH % Now we start filling up Zeroes in T i.1). overlap began to decrease now and each iteration it would decrease % i. end disp (y). Comment only . later t(2)=t(1) Comment only for j = 1:LenH % in the if condition a for loop from 1 to length of H y(i) = y(i) + H(j)*t(j). ylabel('Y[n]'). %displays vector y.e.LenX+LenH). for i=1:s y(i)=0. y = zeros(1. stem(y). end for k = LenH:-1:2 % shifting old value of t(i) to t(i+1) now there would me 1+ non zeroes values in t % this cycle would continue until i is lesser then % length X i.2). end end end ly=length(y) indices=[ly] for i=1:ly indices(i)=i. else y(i)=y(i)+(x(k)*h(i+1-k)). %defining their lenghts LenH = length(H). title('Second Sequence'). for i=1 only firt multiplication would % be non zero rest all zeroes. % in this for loop we multiply all respective vales of h and t and add the % putting it at y(1) or y(2) or Y(i) in first iteration end for k = LenH:-1:2 %% here just like similar loop above t where we were filling up t with vales of x %now we are filling up zeroos in t i.stem(h1.xlabel('n').e overlap about to begin t(1)= X(i). title('First sequence'). subplot(2.e. overlap increasing every iteration less % and less non zero vales in t every iteration t(k) = t(k-1).2. subplot(2.2. disp (indices). h = input('Enter h: ') . LenX = length(X).h).e T moving to left until there is no more % over lap y(i) = y(i) + (H(j)*t(j)). % put x(i) on t(1) later it is shifted forwards in the vector t i.x). subplot(2.xlabel('n'). title('Convoluted sequence').LenH).ylabel('x(n)'). over lap decreasing t(k) = t(k-1).xlabel('n'). 23 Sep 2013 Aghil Vinayak x = input('Enter x: ').Comments and Ratings (25) 28 Jan 2014 assad i=1. %input vector X and H H = input('Enter h: ') .e.y). %defing vector y of zeroes and of size % lenth of X + length of H t = zeros(1. else if (i+1-k)>numel(h) y(i)=y(i)+(x(k)*0).[3 4]).ylabel('h(n)').2.stem(x1. % definign a vector t of same length as H for i = 1:LenH+LenX-1 % Running a for loop from 1 to length of Y -1 if i<=LenX % till I IS Lesser then length of X i. for k=1:numel(x) if (i+1-k)<=0 y(i)=y(i)+(x(k)*0). % displays vector indices. xlabel('[n]'). m)]. Do not bother to download! 23 Mar 2009 Duane Hanselman The content of the M-file is: % A GENERALAZED CONVOLUTION COMPUTING CODE IN MATLAB WITHOUT USING MATLAB BUILTIN FUNCTION conv(x. X=[x.. how can we put this code in the box with the rectangular shape input in simulink? Comment only 28 May 2012 muskan kanwal tehseen sattar can you make it using function so that we should give two input argument to the function and we return the output . end end end Comment only .. y = zeros(1.h) close all clear all x=input('Enter x: ') h=input('Enter h: ') m=length(x). h=[h. for j = 1:Nh y(i) = y(i) + (h(j)*t(j)). end for k = Nh:-1:2 t(k) = t(k-1).zeros(1. Nh = length(h)..zeros(1... for i=1:n+m-1 y(i)=0. Comment only 12 Apr 2012 chiangmai4121 Thank-you Duane. exactly what I was looking for.. Jos(10584) this program is very useful to me. for i = 1:Ni+Nh-1 if i<=Ni t(1)= x(i). 27 Mar 2009 imran shezad Jos (10584) A typical example of a file that has no use for others. 30 Mar 2013 sonali 17 Feb 2013 Abdul-Rauf Mujahid function [y] = myconv( x.m)]. for i=1:n+m-1 Y(i)=0. 14 Jul 2010 ROHIT ALHAT good job man.Ni+Nh). x and h? 23 Sep 2011 hamsa dhia good gob well done 30 Jun 2011 jyotibasu yaranal fine. Thanks again Duane.zeros(1. for j=1:m if(i-j+1>0) y(i)=y(i)+x(j)*h(i-j+1). for j = 1:Nh y(i) = y(i) + h(j)*t(j).n)].n)]. keep ignoring haters like Jos 20 Jan 2012 Mohit Gaur Tim Why are there two inputs. n=length(h). end end end stem(y). n=length(h). end for k = Nh:-1:2 t(k) = t(k-1). t = zeros(1.Nh)..Comments and Ratings (25) Ni = length(x).h ) 26 Dec 2012 Aiman Sultan thanx :) 22 Nov 2012 Nirjhar Roy nice 15 Nov 2012 Mohammad reza nilchiyan good Job man. written in poor C-style code. x=[x. so your comment is wrong. H=[h.zeros(1. for j=1:m 21 Feb 2013 24 Apr 2012 12 Oct 2011 24 Mar 2009 Rama Krishna Tata m=length(x). end else t(1)= 0. xlabel('----->n'). else end end end Y stem(Y). Inc. Featured MathWorks. title('Convolution of Two Signals without conv function').Comments and Ratings (25) if(i-j+1>0) Y(i)=Y(i)+X(j)*H(i-j+1). Contact us Patents © 1994-2016 The MathWorks. ylabel('Y[n]').com Topics: New Products Trademarks Support Privacy Policy Documentation Preventing Piracy Training Terms of Use Webinars Newsletters MATLAB Trials Careers .
Report "Convolution in Matlab Without Using Conv(x h) - File Exchange"
×
Please fill this form, we will try to respond as soon as possible.
Your name
Email
Reason
-Select Reason-
Pornographic
Defamatory
Illegal/Unlawful
Spam
Other Terms Of Service Violation
File a copyright complaint
Description
Copyright © 2024 DOKUMEN.SITE Inc.