Added automatic distance calculation to aliasing_frequency()
Updated functions to use the new aliasing_frequency() function