卷積是在科學、工程和數學中應用最廣泛的運算符之一
卷積是對兩個函數(f和g)進行的一種數學運算,它產生的第三個函數表示其中一個函數的形狀如何被另一個函數修改。
離散時間信號的卷積
一種求解離散時間信號卷積的簡單方法如下所示
輸入序列x[n] ={1,2,3,4},其索引爲{0,1,2,3}
脈衝響應h[n] ={5,6,7,8},其索引爲{- 2,1,0,1}
藍色箭頭表示x[n]和h[n]的第0個索引位置。紅色指針表示輸出卷積索引的第零索引位置。我們可以構造一個表,如下所示。如圖所示,將x和h的元素相乘,然後對角相加。
>> clc; % clears the command window
>> clear all; % clears all the variables in the workspace
>> close all; % closes all the figure window
從用戶那裏獲取輸入
>> % x[n] is the input discrete signal.
>> x=input('Enter the input sequence x =');
>> nx=input('Enter the index of the input sequence nx=');
>> % h[n] is the impulse response of the system.
>>h=input('Enter the impulse response of the system,second sequence h=');
>> nh=input('Enter the index of the second sequence nh=');
輸出
Enter the input sequence x =[1 2 3 4]
Enter the index of the input sequence nx=[0 1 2 3]
Enter the impulse response of the system,second sequence h=[5 6 7 8]
Enter the index of the second sequence nh=[-2 -1 0 1]
計算卷積信號的索引
>> % Index of the convolved signal
>> n=min(nx)+min(nh):max(nx)+max(nh);
卷積計算
>> y=conv(x,h);
顯示
>> disp('The convolved signal is:');
>> y
>> disp('The index of convolved sequence is:');
>> n
>> The convolved signal is:y =5 16 34 60 61 52 32
>> The index of convolved sequence is:n =-2 -1 0 1 2 3 4
可視化
>> subplot(311);
>> stem(nx,x);
>> subplot(312);
>> stem(nh,h);
>> subplot(313);
>> stem(n,y);
時間序列信號的卷積
>> clc;
>> clear all;
>> close all;
>> t=-3:0.01:8;
>> x=(t>=-1 & t<=1); % pulse that exists for t>=-1 and t<=1
>> subplot(311);
>> plot(t,x);
>> h1=(t>=1 & t<=3); % pulse that exists for t>=1 & t<=3
>> h2=(t>3 & t<=4); % pulse that exists for t>3 & t<=4
>> h=h1+(2*h2);
>> subplot(312);
>> plot(t,h);
>> y=convn(x,h);
>> y=y/100;
>> t1=2*min(t):0.01:2*max(t);
>> subplot(313);
>> plot(t1,y);
卷積的屬性
卷積是一個線性算子,具有以下性質。
交換律
x[n] * h[n] = h[n] * x[n] ( in discrete time )
x(t) * h(t) = h(t) * x(t) ( in continuous time )
結合律
x[n] * (h1[n] * h2[n]) = (x[n] * h1[n]) * h2[n] ( in discrete time )
x(t) * (h1(t) * h2(t)) = (x(t) * h1(t)) * h2(t) ( in discrete time )
分配律
x[n] * (h1[n] + h2[n]) = (x[n] * h1[n]) + (x[n] * h2[n]) ( in discrete time )
x(t) * (h1(t) + h2(t)) = (x(t) * h1(t)) + (x(t) * h2(t)) ( in discrete time )
標量乘法結合律
a(f * g) = (af) * g
乘法單位
複共軛性
與微分的關係
與積分的關係
應用程序
卷積在許多領域得到了應用,包括數字圖像處理、數字信號處理、光學、神經網絡、數字數據處理、統計學、工程學、概率論、聲學等等。
作者:Sinchana S R