# Connexions

You are here: Home » Content » Circular Convolution and the DFT

### Recently Viewed

This feature requires Javascript to be enabled.

### Tags

(What is a tag?)

These tags come from the endorsement, affiliation, and other lenses that include this content.

# Circular Convolution and the DFT

Module by: Justin Romberg. E-mail the author

Summary: This module describes the circular convolution algorithm and an alternative algorithm

Note: You are viewing an old version of this document. The latest version is available here.

## Introduction

You should be familiar with Discrete-Time Convolution, which tells us that given two discrete-time signals xn x n , the system's input, and hn h n , the system's response, we define the output of the system as

yn=xn*hn= k =xkhnk y n x n h n k x k h n k
(1)
When we are given two DFTs (finite-length sequences usually of length NN), we cannot just multiply them together as we do in the above convolution formula, often referred to as linear convolution. Because the DFTs are periodic, they have nonzero values for nN n N and thus the multiplication of these two DFTs will be nonzero for nN n N . We need to define a new type of convolution operation that will result in our convolved signal being zero outside of the range n=01N1 n 0 1 N 1 . This idea led to the development of circular convolution, also called cyclic or periodic convolution.

## Circular Convolution Formula

What happens when we multiply two DFT's together, where Yk Y k is the DFT of yn y n ?

Yk=FkHk Y k F k H k
(2)
when 0kN1 0 k N 1

Using the DFT synthesis formula for yn y n

yn=1N k =0N1FkHkej2πNkn y n 1 N k 0 N 1 F k H k j 2 N k n
(3)

And then applying the analysis formula Fk= m =0N1fme(j)2πNkn F k m 0 N 1 f m j 2 N k n

yn=1N k =0N1 m =0N1fme(j)2πNknHkej2πNkn= m =0N1fm(1N k =0N1Hkej2πNk(nm)) y n 1 N k 0 N 1 m 0 N 1 f m j 2 N k n H k j 2 N k n m 0 N 1 f m 1 N k 0 N 1 H k j 2 N k n m
(4)
where we can reduce the second summation found in the above equation into h ( ( n m ) ) N =1N k =0N1Hkej2πNk(nm) h ( ( n m ) ) N 1 N k 0 N 1 H k j 2 N k n m yn= m =0N1fmh ( ( n m ) ) N y n m 0 N 1 f m h ( ( n m ) ) N which equals circular convolution! When we have 0nN1 0 n N 1 in the above, then we get:
ynfnhn y n f n h n
(5)

### note:

The notation represents cyclic convolution "mod N".

### Steps for Cyclic Convolution

Steps for cyclic convolution are the same as the usual convo, except all index calculations are done "mod N" = "on the wheel"

#### Steps for Cyclic Convolution

• Step 1: "Plot" fm f m and h (((m()() N h ( ( m ) ) N
• Step 2: "Spin" h (((m()() N h ( ( m ) ) N n n notches ACW (counter-clockwise) to get h ((n((m()() N h ( ( n m ) ) N (i.e. Simply rotate the sequence, hn h n , clockwise by nn steps).
• Step 3: Pointwise multiply the fm f m wheel and the h ((n((m()() N h ( ( n m ) ) N wheel. sum=yn sum y n
• Step 4: Repeat for all 0nN1 0 n N 1

#### Example 1: Convolve (n = 4)

• h (((m()() N h ( ( m ) ) N

Multiply fm f m and sum sum to yield: y0=3 y 0 3

• h ((1((m()() N h ( ( 1 m ) ) N

Multiply fm f m and sum sum to yield: y1=5 y 1 5

• h ((2((m()() N h ( ( 2 m ) ) N

Multiply fm f m and sum sum to yield: y2=3 y 2 3

• h ((3((m()() N h ( ( 3 m ) ) N

Multiply fm f m and sum sum to yield: y3=1 y 3 1

#### Example 2

The following demonstration allows you to explore this algorithm for circular convolution. See here for instructions on how to use the demo.

LabVIEW Example: (run) (source)

### Alternative Algorithm

#### Alternative Circular Convolution Algorithm

• Step 1: Calculate the DFT of fn f n which yields Fk F k and calculate the DFT of hn h n which yields Hk H k .
• Step 2: Pointwise multiply Yk=FkHk Y k F k H k
• Step 3: Inverse DFT Yk Y k which yields yn y n

Seems like a roundabout way of doing things, but it turns out that there are extremely fast ways to calculate the DFT of a sequence.

To circularily convolve 2 2 N N-point sequences: yn= m =0N1fmh ( ( n m ) ) N y n m 0 N 1 f m h ( ( n m ) ) N For each n n : N N multiples, N1 N 1 additions

N N points implies N2 N 2 multiplications, N(N1) N N 1 additions implies ON2 O N 2 complexity.

## Content actions

### Give feedback:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

#### Definition of a lens

##### Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

##### What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

##### Who can create a lens?

Any individual member, a community, or a respected organization.

##### What are tags?

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks