Aliasing




aliasFreq.m
function [ f_alias ] = aliasFreq( f_sampling, f_noise)
%aliasFreq calculates the aliasing frequency f_alias for
%  a real noise frequency f_noise.
% http://tnotes.de/Aliasing

    f_max = f_sampling / 2;

    f_alias = mod(f_noise,f_sampling);

    if (f_alias>f_max)
        f_alias = f_sampling - f_alias;
    end

end



aliasFreqCan.m
function [ f_cadi_arr ] = aliasFreqCan( f_sampling, f_noise, N)
%aliasFreqCan calculates aliasing frequency candidates for
%  a observed noise frequency f_noise in a estimated spectrum.
%  The candidates are the frequencies of possible noise sources.
% http://tnotes.de/Aliasing

    f_max = f_sampling / 2;

    f_cadi_arr = [];

    f_d = f_max - f_noise;


    for k=1:2:N
        f_r = f_max * k;
        f_cani = f_r - f_d;
        f_cadi_arr = [f_cadi_arr; f_cani];
        f_cani = f_r + f_d;
        f_cadi_arr = [f_cadi_arr; f_cani];

    end

end



Examples
>> aliasFreq(200, 2134)
ans =  66
>> aliasFreq(200, 220)
ans =  20
>> aliasFreq(200, 320)
ans =  80

>> aliasFreqCan(40,10,10)
ans =

	10
	30
	50
	70
	90
   110
   130
   150
   170
   190

>>




Siehe auch

There are no comments on this page. [Add comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki