dfUnityDFT.m 764 Bytes
Newer Older
1
function [ data, samplerate, is_symetric, metadata ] = dfUnityDFT( ~, ~, unity_dft_config )
2 3
% Omnidirectional discrete Fourier transform
    
4 5 6 7 8 9 10 11 12 13 14 15 16
    if ~isempty( fieldnames( unity_dft_config ) )
        channels = unity_dft_config.channels;
        bins = unity_dft_config.length;
        is_symetric = unity_dft_config.is_symmetric;
        samplerate = unity_dft_config.samplerate;
        complex_value = unity_dft_config.complex_value;
    else
        channels = 1;
        bins = 128;
        is_symetric = false;
        samplerate = 44100;
        complex_value = 1 + 1i * 0;
    end
17 18
    
    metadata = [];
19
    data = zeros( channels, bins );
20 21
    for c = 1:channels
        for n = 1:bins
22
            data( c, n ) = complex_value;
23 24 25
        end
    end   
end