low pass and high pass frequency filtering: cutoff value

3 views (last 30 days)
Hi, I want to filter pictures with low and high pass frequency filters. I am using the functions lpfilter.m and hpfilter.m for this. For example:
function H = lpfilter(type, M, N, D0, n)
I want to apply a Gaussian low pass filter, with a cutoff frequency of 4 cycles/degree. Lets say the visual angle is 4 degrees I am in doubt what i should fill in for D0. This is what it says in the function:
% 'gaussian' Gaussian lowpass filter with cutoff (standard deviation) D0. n need not be supplied. D0 must be positive.
I wonder if D0 now basically stands for the cutoff frequency in cycles/image or for something else? If I want a cutoff value of 4 cycles/degree (visual angle is 4 degrees, times 4 cycles = 16), is it then correct that I fill out a value of 16 for D0?
I am sorry to bother you with this, but I cannot seem to find anywhere exactly how people translate the cycles/degree into matlab code. It would be a great help for me if someone knows the answer!

Answers (2)

Image Analyst
Image Analyst on 5 Jun 2012
Do you have a spatial calibration? How do you know how many lines in the image correspond to a degree? Is it 3 lines, or 30 lines, or 173 lines?

Stephanie
Stephanie on 5 Jun 2012
Thanks for your response. To be honest I have no clue how many lines in the image correspond to a degree. I am relatively new to Matlab and have been trying to figure out everything by myself.
The type of image filtering I want to replicate is described in the papers I found as filtering "number of cycles/degree" or "number of cycles/image(width)". Either one of these approaches would be good for me.
As it says in the description of the lpfilter.m code: % Valid values for TYPE, D0, and n are: % 'ideal' Ideal lowpass filter with cutoff frequency D0. n need not be supplied. D0 must be positive % 'btw' Butterworth lowpass filter of order n, and cutoff D0. The default value for n is 1.0. D0 must be positive. % 'gaussian' Gaussian lowpass filter with cutoff (standard deviation) D0. n need not be supplied. D0 must be positive.
I assumed that by specifying the value for D0 I specify the cutoff frequency.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!