Sign in

username:

password:



Not a member?

Search matlab



Search tips

Subscribe to matlab



matlab by Keywords

Atanh | Autocorrelation | Bandpass Filter | C++ | Conv | Database | Deconv | Excel | FFT | Filter | Filtering | FIR | Fourier Transfrom | FSK | Gaussian Noise | Haykin | IFFT | Image | Java | LFSR | LMS | LPC | MEX | OFDM | QPSK | Radix | Random | Sampling | Segmentation | Simulink | Visual Basic | Waveform | Wavelet

Ads

Discussion Groups

Discussion Groups | Matlab DSP | circular conv

Technical discussion about Matlab and issues related to Digital Signal Processing.

  

Post a new Thread

circular conv - harima - Mar 28 8:50:00 2003



Hi there,

Ive a doubt in finding circular convolution of two unequal
sequences in MATLAB. Should the resultant length be equal to the highest of the
given two vectors.

Ive written a code for it but not sure about its result.

Hope there would b some to help me. If neone have still optimised code, do post
it.

Thanks,
Hari.

x = [1 1 1 1 2 1];
h = [1 1 2 1];
Nx = length(x);
Nh = length(h);
N = max(Nx,Nh);
x = [x zeros(1,N-Nx)];
h = [h zeros(1,N-Nh)];

m = 0:1:N-1;
M = mod(-m,N)
h = h(M+1)

for n = 1:1:N
m = n-1;
p = 0:1:N-1;
q = mod(p-m,N)
hm = h(q+1)
H(n,:) = hm
end
Y = x*H'

k = 0:N-1;
subplot(4,4,1);
stem(k,Y);
subplot(4,4,2);
C = conv(x,h);
K = 0:Nx+Nh-4;





(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )

Re: circular conv - Claudio - Mar 31 17:11:00 2003

That's right, in circular convolution the resultant length is the size of the
longest vector.
You can test your results by using the circular convolution matrix, this link
may help you: http://cnx.rice.edu/content/m10459/latest/ Regards,
Claudio U. V.
----- Original Message -----
From: harima
To: matlab
Sent: Sunday, March 30, 2003 2:28 AM
Subject: [matlab] circular conv Hi there,

Ive a doubt in finding circular convolution of two unequal
sequences in MATLAB. Should the resultant length be equal to the highest of the
given two vectors.

Ive written a code for it but not sure about its result.

Hope there would b some to help me. If neone have still optimised code, do
post it.

Thanks,
Hari.

x = [1 1 1 1 2 1];
h = [1 1 2 1];
Nx = length(x);
Nh = length(h);
N = max(Nx,Nh);
x = [x zeros(1,N-Nx)];
h = [h zeros(1,N-Nh)];

m = 0:1:N-1;
M = mod(-m,N)
h = h(M+1)

for n = 1:1:N
m = n-1;
p = 0:1:N-1;
q = mod(p-m,N)
hm = h(q+1)
H(n,:) = hm
end
Y = x*H'

k = 0:N-1;
subplot(4,4,1);
stem(k,Y);
subplot(4,4,2);
C = conv(x,h);
Yahoo! Groups Sponsor
ADVERTISEMENT

_____________________________________
/groups.php3

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.




(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )