Skip to content
Snippets Groups Projects
Commit 5980a94a authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Adding figure-of-eight example with magnitude and phase

parent 18915cf1
No related branches found
No related tags found
No related merge requests found
......@@ -100,6 +100,19 @@ daffv17_write('filename', 'ExampleFigureOfEightFront.ms.daff', ...
'quantization', 'float32' );
disp( ' ' )
%%
daffv17_write('filename', 'ExampleFigureOfEightFront.mps.daff', ...
'content', 'mps', ...
'datafunc', @dfFigureOfEightMPS, ...
'channels', channels, ...
'alphares', alpha_res, ...
'betares', beta_res, ...
'orient', default_orient, ...
'metadata', metadata, ...
'quantization', 'float32' );
disp( ' ' )
%%
daffv17_write('filename', 'ExampleFigureOfEightSide.ms.daff', ...
'content', 'ms', ...
'datafunc', @dfFigureOfEightMS, ...
......
function [ freqs, data_complex, metadata ] = dfFigureOfEightMPS( alpha, beta, ~ )
channelnum = 1;
% Third-octave resolution
freqs = [20 25 31.5 40 50 63 80 100 125 160 ...
200 250 315 400 500 630 800 1000 1250 1600 ...
2000 2500 3150 4000 5000 6300 8000 10000 12500 16000 20000];
metadata = [];
data_complex = zeros( channelnum, numel( freqs ) );
for c = 1:channelnum
for f = 1:numel( freqs )
magnitude = cos( deg2rad( alpha ) ) * sin( deg2rad( beta ) );
phase = 2 * pi * magnitude;
data_complex( c, f ) = abs( magnitude ) * exp( 1i * phase );
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment