SCILAB: Komfortable Audio Signalanalyse
brummfritz
Forum-Anfänger
Beiträge: 21
Anmeldedatum: 01.09.16
Wohnort: Düsseldorf
Version: Matlab R2015b
Verfasst am : 10.07.2017, 00:59
Titel : SCILAB: Komfortable Audio Signalanalyse
SCILAB ist klasse!!!
Der Skript läuft unter Scilab 6
Eine Audiodatei, Kanal 1, wird je Sekunde analysiert. Die gesamte Audio-Datei kann von Sekunde zu Sekunde durchgeblättert werden.
Die entsprechende Sekunde wird in folgender Weise analysiert.
Grafisch angezeigt werden Wav, Gleichspannungsanteil, FFT, Leistungsspektrum, und mit der FFT wird das ursprüngliche Wav Signal wieder berechnet. Mit einstellbarer oberer Grenzfrequenz.
Code:
// Signalanalyse 6
mclose( 'all ') ;
clear ;
xdel( ) ;
z=struct ( 'wa ',0 ,'ft ',0 ,'ftl ',0 ,'ftr ',0 ,'st1 ',0 ,'st2 ',0 ,'lz ',0 ,'g ',0 ,'da ',0 ,'pf ',0 ,'re ',0 ,'sf ',0 ,'pfda ',0 ,'info ',0 ,'vs ',1 ,'h1 ',0 ,'f1 ',0 ,'h2 ',0 ,'f2 ',0 ,'h3 ',0 ,'f3 ',0 ,'h4 ',0 ,'f4 ',0 ,'h5 ',0 ,'f5 ',0 ,'po ',0 ,'fi ',0 ) ;
/////////////////////////////////////////////////////////////////////////////
function [ z] =neudatei( z)
//////////////////////////////////////////////////////////////////////////////
// WAV Datei auswählen D:\Mdaten\Testsignale/100Hz-03A_g.wav
[ z.da ,z.pf ] =uigetfile ( '*.wav ','D:\Mdaten ') ; //WAV Datei wählen
if isequal ( z.da ,'') ; //Ist eine Date gewählt?
else
z.pfda =z.pf +'\ '+z.da ; //Vollständigen Pfad erstellen
z.info = wavread ( z.pfda ,'info ') ; //WAV Info`s laden
disp ( '////////////////////////////////////////////////////////// ')
disp ( 'WAV-Datei: '+z.pfda ) ; //Ausgabe vollständiger Pfad
disp ( 'Kanäle: '+string( z.info ( 2 ) ) ) ; //Ausgabe Anzahl der Kanäle
disp ( 'Samplerate: '+string( z.info ( 3 ) ) ) ; //Ausgabe Samplerate
disp ( 'Dateilänge : '+string( z.info ( 8 ) ) ) ; //Ausgabe Dateilänge
disp ( 'Laufzeit : '+string( z.info ( 8 ) /z.info ( 3 ) ) +' Sekunden ') ; //Laufzeit in Sek.
disp ( '////////////////////////////////////////////////////////// ')
z.lz =floor ( z.info ( 8 ) /z.info ( 3 ) ) ; // lauzeit in sekunden
z.sf =z.info ( 3 ) ; //Samplerate der Audiodatei
set ( u6,'string ',z.pfda ) ;
//
set ( u11, 'min ',1 ) ;
set ( u11,'max ',z.lz ) ;
//
if z.f1 ==0 then
else
delete ( z.f1 ) ;
delete ( z.f2 ) ;
delete ( z.f3 ) ;
delete ( z.f4 ) ;
delete ( z.f5 ) ;
end
//
z.po =u11.value ;
set ( u3,'string ','Max '+string( z.lz ) ) ;
if z.po <1 then
u11.value =1 ;
z.po =u11.value ;
end
if z.po >z.lz then
u11.value =z.lz ;
z.po =u11.value ;
end
set ( u3,'string ',string( z.lz ) ) ;
set ( u12,'value ',1 ) ;
set ( u16,'value ',1 ) ;
set ( u22,'value ',1 ) ;
set ( u27,'value ',1 ) ;
z.st2 =z.po*z .sf ;
z.st1 =z.st2 -z.sf +1 ;
[ z] =rechenwerk( z) ;
[ z] =obenlinks( z) ;
[ z] =mitteseite( z) ;
[ z] =obenrechts( z) ;
[ z] =untenlinks( z) ;
[ z] =untenrechts( z) ;
end
endfunction
/////////////////////////////////////////////////////////////////////////////
function [ z] =rechenwerk( z) // rechenwerk
//// FFT brechnen
z.wa =wavread ( z.pfda ,[ z.st1 z.st2 ] ) ;
z.wa =z.wa ( 1 ,:) ;
z.wa =z.wa*z .vs ;// verstärkung
z.ft =fft ( z.wa ,-1 ,'nonsymmetric ') ; //Die FFT wird berechnen
z.ft =z.ft /z.sf ;
z.g =abs ( z.ft ( 1 ) ) ;
z.ftr =z.ft ;
z.ft =abs ( z.ft ( 2 :z.sf ) ) ;
// powerspektrum
z.ftl =z.ft
z.ftl =abs ( z.ft .* conj ( z.ft ) ) ; //Powerspektrum der FFT berechnen
// rücktransformation
y=z.ftr ;
y( 1 ) =0 ;
y( z.fo +2 :z.sf ) =0 ;
z.re =fft ( y,1 ) *z.sf* 2 ;//
// normieren
z.g =z.g* 1000 ;// normieren
z.ft =z.ft* 2000 ;// normieren
z.ftl =z.ftl* 4000 ;// normieren
////
endfunction
/////////////////////////////////////////////////////////////////////////////
function [ z] =obenlinks( z)
sca( z.h1 )
s=z.wa*z .vs ;
plot ( s,'magenta ','thickness ',1 ) ;
z.f1 =gce( ) ;
z.h1 .visible = "on";
z.h1 .axes_visible = [ "on","on","on"] ;
z.h1 .axes_reverse = [ "off","off","off"] ;
z.h1 .auto_ticks = [ "off","off","off"] ;
z.h1 .grid = [ 1 ,1 ] ;
z.h1 .grid_thickness = [ 1 ,1 ] ;
z.h1 .grid_style = [ 1 ,1 ] ;
z.h1 .grid_position = "background";
z.h1 .title .font_size =2 ;
z.h1 .title .text ="WAV Signal";
z.h1 .x_label .font_size =2 ;
z.h1 .x_label .text ="Zeit in Millisekunden";
z.h1 .x_label .visible ="on";
z.h1 .y_label .font_size =2 ;
z.h1 .y_label .text ="Amplitude";
z.h1 .y_label .visible ="on";
z.h1 .auto_scale ="off";
// zeitachse
z.h1 .x_ticks =tlist( [ 'locations ','labels '] ,[ 1 ,4800 ,9600 ,14400 ,19200 ,24000 ,28800 ,33600 ,38400 ,43200 ,48000 ] ,[ "0 ","100 ","200 ","300 ","400 ","500 ","600 ","700 ","800 ","900 ","1000 "] ) ;
// amplitudenachse
z.h1 .y_ticks =tlist( [ 'locations ','labels '] ,[ -1 ,-0.9 ,-0.8 ,-0.7 ,-0.6 ,-0.5 ,-0.4 ,-0.3 ,-0.2 ,-0.1 ,0 ,0.1 ,0.2 ,0.3 ,0.4 ,0.5 ,0.6 ,0.7 ,0.8 ,0.9 ,1 ] ,[ "-1 ","-0.9 ","-0.8 ","-0.7 ","-0.6 ","-0.5 ","-0.4 ","-0.3 ","-0.2 ","-0.1 ","0 ","0.1 ","0.2 ","0.3 ","0.4 ","0.5 ","0.6 ","0.7 ","0.8 ","0.9 ","1 "] ) ;
z.h1 .sub_tics =[ 9 ,9 ,9 ] ;
z.h1 .box = "back_half";
z.h1 .background = -2 ;
z.h1 .tight_limits = [ "on","on"] ;
z.h1 .cube_scaling = "on";
z.h1 .isoview = "off";
// mit den folgenden einstellungen der drei achsen kann die Anzeige angepasst werden
/////////////////////////////////////////////////////////////////////////////
zh=z.h1 .data_bounds ;
zh( 1 ,2 ) =-1 ;
zh( 2 ,2 ) =1 ;
zh( 1 ,1 ) =1 ;
zh( 2 ,1 ) =z.sf ;
z.h1 .data_bounds =zh;
z.h1 .tag ='Links ';
//z.so =zi.so -1 ;
//
////////////////////////
endfunction
//////////////////////////////////////////////////////////////////////
function [ z] =mitteseite( z)
sca( z.h2 ) ;
bar ( 0 ,z.g ,1 ,'green ') ;
z.f2 =gce( ) ;
z.h2 .visible = "on";
z.h2 .axes_visible = [ "on","on","on"] ;
z.h2 .axes_reverse = [ "off","off","off"] ;
z.h2 .auto_ticks = [ "off","off","off"] ;
z.h2 .grid = [ 1 ,1 ] ;
z.h2 .grid_thickness = [ 1 ,1 ] ;
z.h2 .grid_style = [ 1 ,1 ] ;
z.h2 .grid_position = "background";
z.h2 .title .font_size =2 ;
z.h2 .title .text ="DC";
z.h2 .x_label .font_size =2 ;
//zi.h4 .x_label .text ="";
//zi.h4 .x_label .visible ="on";
z.h2 .y_label .font_size =2 ;
z.h2 .y_label .text ="Amplitude";
z.h2 .y_label .visible ="on";
z.h2 .auto_scale ="off";
// zeitachse
//zi.h4 .x_ticks =tlist( [ 'locations ','labels '] ,[ 0 ] ,[ '0 '] ) ;
// amplitudenachse
z.h2 .y_ticks =tlist( [ 'locations ','labels '] ,[ 0 ,100 ,200 ,300 ,400 ,500 ,600 ,700 ,800 ,900 ,1000 ] ,[ "0 ","0.1 ","0.2 ","0.3 ","0.4 ","0.5 ","0.6 ","0.7 ","0.8 ","0.9 ","1 "] ) ;
z.h2 .sub_tics =[ 9 ,0 ,0 ] ;
z.h2 .box = "back_half";
z.h2 .background = -2 ;
z.h2 .tight_limits = [ "on","on"] ;
z.h2 .cube_scaling = "off";
z.h2 .isoview = "off";
// mit den folgenden einstellungen der drei achsen kann die Anzeige angepasst werden
/////////////////////////////////////////////////////////////////////////////
zh=z.h2 .data_bounds ;
zh( 1 ,2 ) =0 ;
zh( 2 ,2 ) =1000 ;
zh( 1 ,1 ) =-0.1 ;
zh( 2 ,1 ) =0.1 ;
z.h2 .data_bounds =zh;
z.h2 .tag ='Mitte ';
//
////////////////////////
endfunction
//////////////////////////////////////////////////////////////////////
function [ z] =obenrechts( z)
sca( z.h3 )
v=z.ft ( 1 :500 ) ;
plot ( v,'blue ','thickness ',2 ) ;
z.f3 =gce( )
//////////////////////
z.h3 .visible = "on";
z.h3 .axes_visible = [ "on","on","on"] ;
z.h3 .axes_reverse = [ "off","off","off"] ;
z.h3 .auto_ticks = [ "off","off","off"] ;
z.h3 .grid = [ 1 ,1 ] ;
z.h3 .grid_thickness = [ 1 ,1 ] ;
z.h3 .grid_style = [ 1 ,1 ] ;
z.h3 .grid_position = "background";
z.h3 .title .font_size =2 ;
z.h3 .title .text ="FFT Spektrum";
z.h3 .x_label .font_size =2 ;
z.h3 .x_label .text ="Frequenz";
z.h3 .x_label .visible ="on";
z.h3 .y_label .font_size =2 ;
z.h3 .y_label .text ="Amplitude";
z.h3 .y_label .visible ="on";
z.h3 .auto_scale ="off";
// frequenzaschse
z.h3 .x_ticks =tlist( [ 'locations ','labels '] ,[ 0 ,10 ,20 ,30 ,40 ,50 ,60 ,70 ,80 ,90 ,100 ,110 ,120 ,130 ,140 ,150 ,160 ,170 ,180 ,190 ,200 ,210 ,220 ,230 ,240 ,250 ,260 ,270 ,280 ,290 ,300 ,310 ,320 ,330 ,340 ,350 ,360 ,370 ,380 ,390 ,400 ,410 ,420 ,430 ,440 ,450 ,460 ,470 ,480 ,490 ,500 ] ,[ "0 ","10 ","20 ","30 ","40 ","50 ","60 ","70 ","80 ","90 ","100 ","110 ","120 ","130 ","140 ","150 ","160 ","170 ","180 ","190 ","200 ","210 ","220 ","230 ","240 ","250 ","260 ","270 ","280 ","290 ","300 ","310 ","320 ","330 ","340 ","350 ","360 ","370 ","380 ","390 ","400 ","410 ","420 ","430 ","440 ","450 ","460 ","470 ","480 ","490 ","500 "] ) ;
// amplitudenachse
z.h3 .y_ticks =tlist( [ 'locations ','labels '] ,[ 1 ,100 ,200 ,300 ,400 ,500 ,600 ,700 ,800 ,900 ,1000 ] ,[ "0 ","0.1 ","0.2 ","0.3 ","0.4 ","0.5 ","0.6 ","0.7 ","0.8 ","0.9 ","1 "] ) ;
z.h3 .sub_tics =[ 9 ,9 ,9 ] ;
z.h3 .box = "back_half";
z.h3 .background = -2 ;
z.h3 .tight_limits = [ "off","off"] ;
z.h3 .cube_scaling = "on";
z.h3 .isoview = "off";
// mit den folgenden einstellungen der drei achsen kann die Anzeige angepasst werden
/////////////////////////////////////////////////////////////////////////////
zh=z.h3 .data_bounds ;
zh( 1 ,2 ) =0 ;
zh( 2 ,2 ) =1000 ;
zh( 1 ,1 ) =0 ;
zh( 2 ,1 ) =250 ;
z.h3 .data_bounds =zh;
z.h3 .tag ='Rechts ';
///////////////////////////////////////////////////////////////////////
endfunction
///////////////////////////////////////////////////////////////////////
function [ z] =untenlinks( z)
sca( z.h4 ) ;
v=z.re ;
plot ( v,'red ','thickness ',1 ) ;
z.f4 =gce( ) ;
z.h4 .visible = "on";
z.h4 .axes_visible = [ "on","on","on"] ;
z.h4 .axes_reverse = [ "off","off","off"] ;
z.h4 .auto_ticks = [ "off","off","off"] ;
z.h4 .grid = [ 1 ,1 ] ;
z.h4 .grid_thickness = [ 1 ,1 ] ;
z.h4 .grid_style = [ 1 ,1 ] ;
z.h4 .grid_position = "background";
z.h4 .title .font_size =2 ;
z.h4 .title .text ="Rücktransformation mit F-Max";
z.h4 .x_label .font_size =2 ;
z.h4 .x_label .text ="Zeit in Millisekunden";
z.h4 .x_label .visible ="on";
z.h4 .y_label .font_size =2 ;
z.h4 .y_label .text ="Amplitude";
z.h4 .y_label .visible ="on";
z.h4 .auto_scale ="off";
// zeitachse
z.h4 .x_ticks =tlist( [ 'locations ','labels '] ,[ 1 ,4800 ,9600 ,14400 ,19200 ,24000 ,28800 ,33600 ,38400 ,43200 ,48000 ] ,[ "0 ","100 ","200 ","300 ","400 ","500 ","600 ","700 ","800 ","900 ","1000 "] ) ;
// amplitudenachse
z.h4 .y_ticks =tlist( [ 'locations ','labels '] ,[ -1 ,-0.9 ,-0.8 ,-0.7 ,-0.6 ,-0.5 ,-0.4 ,-0.3 ,-0.2 ,-0.1 ,0 ,0.1 ,0.2 ,0.3 ,0.4 ,0.5 ,0.6 ,0.7 ,0.8 ,0.9 ,1 ] ,[ "-1 ","-0.9 ","-0.8 ","-0.7 ","-0.6 ","-0.5 ","-0.4 ","-0.3 ","-0.2 ","-0.1 ","0 ","0.1 ","0.2 ","0.3 ","0.4 ","0.5 ","0.6 ","0.7 ","0.8 ","0.9 ","1 "] ) ;
z.h4 .sub_tics =[ 9 ,9 ,9 ] ;
z.h4 .box = "back_half";
z.h4 .background = -2 ;
z.h4 .tight_limits = [ "on","on"] ;
z.h4 .cube_scaling = "on";
z.h4 .isoview = "off";
// mit den folgenden einstellungen der drei achsen kann die Anzeige angepasst werden
/////////////////////////////////////////////////////////////////////////////
zh=z.h4 .data_bounds ;
zh( 1 ,2 ) =-1 ;
zh( 2 ,2 ) =1 ;
zh( 1 ,1 ) =1 ;
zh( 2 ,1 ) =z.sf ;
z.h4 .data_bounds =zh;
z.h4 .tag ='Unten ';
//
endfunction
/////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
function [ z] =untenrechts( z)
sca( z.h5 )
v=z.ftl ( 1 :500 ) ;
plot ( v,'red ','thickness ',2 ) ;
z.f5 =gce( )
//////////////////////
z.h5 .visible = "on";
z.h5 .axes_visible = [ "on","on","on"] ;
z.h5 .axes_reverse = [ "off","off","off"] ;
z.h5 .auto_ticks = [ "off","off","off"] ;
z.h5 .grid = [ 1 ,1 ] ;
z.h5 .grid_thickness = [ 1 ,1 ] ;
z.h5 .grid_style = [ 1 ,1 ] ;
z.h5 .grid_position = "background";
z.h5 .title .font_size =2 ;
z.h5 .title .text ="FFT Leistungsspektrum";
z.h5 .x_label .font_size =2 ;
z.h5 .x_label .text ="Frequenz";
z.h5 .x_label .visible ="on";
z.h5 .y_label .font_size =2 ;
z.h5 .y_label .text ="Amplitude";
z.h5 .y_label .visible ="on";
z.h5 .auto_scale ="off";
// frequenzaschse
z.h5 .x_ticks =tlist( [ 'locations ','labels '] ,[ 0 ,10 ,20 ,30 ,40 ,50 ,60 ,70 ,80 ,90 ,100 ,110 ,120 ,130 ,140 ,150 ,160 ,170 ,180 ,190 ,200 ,210 ,220 ,230 ,240 ,250 ,260 ,270 ,280 ,290 ,300 ,310 ,320 ,330 ,340 ,350 ,360 ,370 ,380 ,390 ,400 ,410 ,420 ,430 ,440 ,450 ,460 ,470 ,480 ,490 ,500 ] ,[ "0 ","10 ","20 ","30 ","40 ","50 ","60 ","70 ","80 ","90 ","100 ","110 ","120 ","130 ","140 ","150 ","160 ","170 ","180 ","190 ","200 ","210 ","220 ","230 ","240 ","250 ","260 ","270 ","280 ","290 ","300 ","310 ","320 ","330 ","340 ","350 ","360 ","370 ","380 ","390 ","400 ","410 ","420 ","430 ","440 ","450 ","460 ","470 ","480 ","490 ","500 "] ) ;
// amplitudenachse
z.h5 .y_ticks =tlist( [ 'locations ','labels '] ,[ 1 ,100 ,200 ,300 ,400 ,500 ,600 ,700 ,800 ,900 ,1000 ] ,[ "0 ","0.1 ","0.2 ","0.3 ","0.4 ","0.5 ","0.6 ","0.7 ","0.8 ","0.9 ","1 "] ) ;
z.h5 .sub_tics =[ 9 ,9 ,9 ] ;
z.h5 .box = "back_half";
z.h5 .background = -2 ;
z.h5 .tight_limits = [ "off","off"] ;
z.h5 .cube_scaling = "on";
z.h5 .isoview = "off";
// mit den folgenden einstellungen der drei achsen kann die Anzeige angepasst werden
/////////////////////////////////////////////////////////////////////////////
zh=z.h5 .data_bounds ;
zh( 1 ,2 ) =0 ;
zh( 2 ,2 ) =1000 ;
zh( 1 ,1 ) =0 ;
zh( 2 ,1 ) =250 ;
z.h5 .data_bounds =zh;
z.h5 .tag ='Rechts ';
///////////////////////////////////////////////////////////////////////
endfunction
///////////////////////////////////////////////////////////////////////
function [ z] =verst( z)
if z.f1 ==0 then
else
delete ( z.f1 ) ;
delete ( z.f2 ) ;
delete ( z.f3 ) ;
delete ( z.f4 ) ;
delete ( z.f5 ) ;
end
z.vs =u7.value ;
[ z] =rechenwerk( z) ;
// linkeseite
sca( z.h1 )
s=z.wa*z .vs ;
plot ( s,'magenta ','thickness ',1 ) ;
z.f1 =gce( ) ;
//mitteseite;
sca( z.h2 ) ;
bar ( 0 ,z.g ,1 ,'green ') ;
z.f2 =gce( ) ;
// rechteseite
sca( z.h3 ) ;
v=z.ft ( 1 :500 ) ;
plot ( v,'blue ','thickness ',2 ) ;
z.f3 =gce( ) ;
//untenlinks
sca( z.h4 ) ;
v=z.re ;
plot ( v,'red ','thickness ',1 ) ;
z.f4 =gce( ) ;
//untenrechts
sca( z.h5 ) ;
v=z.ftl ( 1 :500 ) ;
plot ( v,'red ','thickness ',2 ) ;
z.f5 =gce( ) ;
//
endfunction
/////////////////////////////////////////////////////////////////////////////
function [ z] =fober( z)
if z.f4 ==0 then
else
delete ( z.f4 ) ;
//
z.fo =u9.value ;
if z.fo > 250 then
u9.value =250 ;
z.fo =u9.value ;
end
if z.fo < 1 then
u9.value =250 ;
z.fo =u9.value ;
end
//
y=z.ftr ;
y( 1 ) =0 ;
y( z.fo +2 :z.sf ) =0 ;
z.re =fft ( y,1 ) *z.sf* 2 ;//
sca( z.h4 ) ;
v=z.re ;
plot ( v,'red ','thickness ',1 ) ;
z.f4 =gce( ) ;
end
endfunction
/////////////////////////////////////////////////////////////////////////////
function [ z] =position( z)
z.po =u11.value ;
if z.po <1 then
u11.value =1 ;
z.po =u11.value ;
end
if z.po >z.lz then
u11.value =z.lz ;
z.po =u11.value ;
end
if z.f1 ==0 then
else
delete ( z.f1 ) ;
delete ( z.f2 ) ;
delete ( z.f3 ) ;
delete ( z.f4 ) ;
delete ( z.f5 ) ;
end
//set ( u3,'string ',string( z.po ) +'. Sek . von '+string( z.lz ) ) ;
//z.st1 =z.po*z .sf ;
z.st2 =z.po*z .sf ;
z.st1 =z.st2 -z.sf +1 ;
[ z] =rechenwerk( z) ;
// linkeseite
sca( z.h1 )
s=z.wa*z .vs ;
plot ( s,'magenta ','thickness ',1 ) ;
z.f1 =gce( ) ;
//mitteseite;
sca( z.h2 ) ;
bar ( 0 ,z.g ,1 ,'green ') ;
z.f2 =gce( ) ;
// rechteseite
sca( z.h3 ) ;
v=z.ft ( 1 :500 ) ;
plot ( v,'blue ','thickness ',2 ) ;
z.f3 =gce( ) ;
//untenlinks
sca( z.h4 ) ;
v=z.re ;
plot ( v,'red ','thickness ',1 ) ;
z.f4 =gce( ) ;
//untenrechts
sca( z.h5 ) ;
v=z.ftl ( 1 :500 ) ;
plot ( v,'red ','thickness ',2 ) ;
z.f5 =gce( ) ;
//
endfunction
/////////////////////////////////////////////////////////////////////////////
function [ z] =fenster3( z)
if u12.value ==1 then
// amplitudenachse
z.h3 .y_ticks =tlist( [ 'locations ','labels '] ,[ 0 ,100 ,200 ,300 ,400 ,500 ,600 ,700 ,800 ,900 ,1000 ] ,[ "0 ","0.1 ","0.2 ","0.3 ","0.4 ","0.5 ","0.6 ","0.7 ","0.8 ","0.9 ","1 "] ) ;
zh=z.h3 .data_bounds ;
zh( 1 ,2 ) =0 ;
zh( 2 ,2 ) =1000 ;
//zh( 1 ,1 ) =0 ;
//zh( 2 ,1 ) =250 ;
z.h3 .data_bounds =zh;
end
///////////////////////////
if u13.value ==1 then
// amplitudenachse
z.h3 .y_ticks =tlist( [ 'locations ','labels '] ,[ 0 ,50 ,100 ,150 ,200 ,250 ,300 ,350 ,400 ,450 ,500 ] ,[ "0 ","0.05 ","0.1 ","0.15 ","0.2 ","0.25 ","0.3 ","0.35 ","0.4 ","0.45 ","0.5 "] ) ;
zh=z.h3 .data_bounds ;
zh( 1 ,2 ) =0 ;
zh( 2 ,2 ) =500 ;
//zh( 1 ,1 ) =0 ;
//zh( 2 ,1 ) =250 ;
z.h3 .data_bounds =zh;
end
///////////////////////////
if u14.value ==1 then
// amplitudenachse
z.h3 .y_ticks =tlist( [ 'locations ','labels '] ,[ 0 ,25 ,50 ,75 ,100 ,125 ,150 ,175 ,200 ,225 ,250 ] ,[ "0 ","0.025 ","0.05 ","0.075 ","0.1 ","0.125 ","0.15 ","0.175 ","0.2 ","0.225 ","0.25 "] ) ;
zh=z.h3 .data_bounds ;
zh( 1 ,2 ) =0 ;
zh( 2 ,2 ) =250 ;
//zh( 1 ,1 ) =0 ;
//zh( 2 ,1 ) =250 ;
z.h3 .data_bounds =zh;
end
///////////////////////////
if u15.value ==1 then
// amplitudenachse
z.h3 .y_ticks =tlist( [ 'locations ','labels '] ,[ 0 ,10 ,20 ,30 ,40 ,50 ,60 ,70 ,80 ,90 ,100 ] ,[ "0 ","0.01 ","0.02 ","0.03 ","0.04 ","0.05 ","0.06 ","0.07 ","0.08 ","0.09 ","0.1 "] ) ;
zh=z.h3 .data_bounds ;
zh( 1 ,2 ) =0 ;
zh( 2 ,2 ) =100 ;
//zh( 1 ,1 ) =0 ;
//zh( 2 ,1 ) =250 ;
z.h3 .data_bounds =zh;
end
///////////////////////////
endfunction
////////////////////////////////////////////////////////////////////////////
function [ z] =fenster5( z)
if u16.value ==1 then
// amplitudenachse
z.h5 .y_ticks =tlist( [ 'locations ','labels '] ,[ 0 ,100 ,200 ,300 ,400 ,500 ,600 ,700 ,800 ,900 ,1000 ] ,[ "0 ","0.1 ","0.2 ","0.3 ","0.4 ","0.5 ","0.6 ","0.7 ","0.8 ","0.9 ","1 "] ) ;
zh=z.h5 .data_bounds ;
zh( 1 ,2 ) =0 ;
zh( 2 ,2 ) =1000 ;
//zh( 1 ,1 ) =0 ;
//zh( 2 ,1 ) =250 ;
z.h5 .data_bounds =zh;
end
///////////////////////////
if u17.value ==1 then
// amplitudenachse
z.h5 .y_ticks =tlist( [ 'locations ','labels '] ,[ 0 ,50 ,100 ,150 ,200 ,250 ,300 ,350 ,400 ,450 ,500 ] ,[ "0 ","0.05 ","0.1 ","0.15 ","0.2 ","0.25 ","0.3 ","0.35 ","0.4 ","0.45 ","0.5 "] ) ;
zh=z.h5 .data_bounds ;
zh( 1 ,2 ) =0 ;
zh( 2 ,2 ) =500 ;
//zh( 1 ,1 ) =0 ;
//zh( 2 ,1 ) =250 ;
z.h5 .data_bounds =zh;
end
///////////////////////////
if u18.value ==1 then
// amplitudenachse
z.h5 .y_ticks =tlist( [ 'locations ','labels '] ,[ 0 ,25 ,50 ,75 ,100 ,125 ,150 ,175 ,200 ,225 ,250 ] ,[ "0 ","0.025 ","0.05 ","0.075 ","0.1 ","0.125 ","0.15 ","0.175 ","0.2 ","0.225 ","0.25 "] ) ;
zh=z.h5 .data_bounds ;
zh( 1 ,2 ) =0 ;
zh( 2 ,2 ) =250 ;
//zh( 1 ,1 ) =0 ;
//zh( 2 ,1 ) =250 ;
z.h5 .data_bounds =zh;
end
///////////////////////////
if u19.value ==1 then
// amplitudenachse
z.h5 .y_ticks =tlist( [ 'locations ','labels '] ,[ 0 ,10 ,20 ,30 ,40 ,50 ,60 ,70 ,80 ,90 ,100 ] ,[ "0 ","0.01 ","0.02 ","0.03 ","0.04 ","0.05 ","0.06 ","0.07 ","0.08 ","0.09 ","0.1 "] ) ;
zh=z.h5 .data_bounds ;
zh( 1 ,2 ) =0 ;
zh( 2 ,2 ) =100 ;
//zh( 1 ,1 ) =0 ;
//zh( 2 ,1 ) =250 ;
z.h5 .data_bounds =zh;
end
///////////////////////////
endfunction
///////////////////////////////////////
function [ z] =fenster3f( z)
if u21.value ==1 then
// frequenzaschse
z.h3 .x_ticks =tlist( [ 'locations ','labels '] ,[ 0 ,20 ,40 ,60 ,80 ,100 ,120 ,140 ,160 ,180 ,200 ,220 ,240 ,260 ,280 ,300 ,320 ,340 ,360 ,380 ,400 ,420 ,440 ,460 ,480 ,500 ] ,[ "1 ","20 ","40 ","60 ","80 ","100 ","120 ","140 ","160 ","180 ","200 ","220 ","240 ","260 ","280 ","300 ","320 ","340 ","360 ","380 ","400 ","420 ","440 ","460 ","480 ","500 "] ) ;
zh=z.h3 .data_bounds ;
//zh( 1 ,2 ) =0 ;
//zh( 2 ,2 ) =1000 ;
zh( 1 ,1 ) =0 ;
zh( 2 ,1 ) =500 ;
z.h3 .data_bounds =zh;
end
//
if u22.value ==1 then
// frequenzaschse
z.h3 .x_ticks =tlist( [ 'locations ','labels '] ,[ 0 ,10 ,20 ,30 ,40 ,50 ,60 ,70 ,80 ,90 ,100 ,110 ,120 ,130 ,140 ,150 ,160 ,170 ,180 ,190 ,200 ,210 ,220 ,230 ,240 ,250 ] ,[ "0 ","10 ","20 ","30 ","40 ","50 ","60 ","70 ","80 ","90 ","100 ","110 ","120 ","130 ","140 ","150 ","160 ","170 ","180 ","190 ","200 ","210 ","220 ","230 ","240 ","250 "] ) ;
zh=z.h3 .data_bounds ;
//zh( 1 ,2 ) =0 ;
//zh( 2 ,2 ) =1000 ;
zh( 1 ,1 ) =0 ;
zh( 2 ,1 ) =250 ;
z.h3 .data_bounds =zh;
end
//
//
if u23.value ==1 then
// frequenzaschse
z.h3 .x_ticks =tlist( [ 'locations ','labels '] ,[ 0 ,10 ,20 ,30 ,40 ,50 ,60 ,70 ,80 ,90 ,100 ,110 ,120 ,130 ] ,[ "0 ","10 ","20 ","30 ","40 ","50 ","60 ","70 ","80 ","90 ","100 ","110 ","120 ","130 "] ) ;
zh=z.h3 .data_bounds ;
//zh( 1 ,2 ) =0 ;
//zh( 2 ,2 ) =1000 ;
zh( 1 ,1 ) =0 ;
zh( 2 ,1 ) =120 ;
z.h3 .data_bounds =zh;
end
if u24.value ==1 then
// frequenzaschse
z.h3 .x_ticks =tlist( [ 'locations ','labels '] ,[ 0 ,5 ,10 ,15 ,20 ,25 ,30 ,35 ,40 ,45 ,50 ,55 ,60 ] ,[ "0 ","5 ","10 ","15 ","20 ","25 ","30 ","35 ","40 ","45 ","50 ","55 ","60 "] ) ;
zh=z.h3 .data_bounds ;
//zh( 1 ,2 ) =0 ;
//zh( 2 ,2 ) =1000 ;
zh( 1 ,1 ) =0 ;
zh( 2 ,1 ) =60 ;
z.h3 .data_bounds =zh;
end
endfunction
/////////////////////////
function [ z] =fenster5f( z)
if u26.value ==1 then
// frequenzaschse
z.h5 .x_ticks =tlist( [ 'locations ','labels '] ,[ 0 ,20 ,40 ,60 ,80 ,100 ,120 ,140 ,160 ,180 ,200 ,220 ,240 ,260 ,280 ,300 ,320 ,340 ,360 ,380 ,400 ,420 ,440 ,460 ,480 ,500 ] ,[ "1 ","20 ","40 ","60 ","80 ","100 ","120 ","140 ","160 ","180 ","200 ","220 ","240 ","260 ","280 ","300 ","320 ","340 ","360 ","380 ","400 ","420 ","440 ","460 ","480 ","500 "] ) ;
zh=z.h5 .data_bounds ;
//zh( 1 ,2 ) =0 ;
//zh( 2 ,2 ) =1000 ;
zh( 1 ,1 ) =0 ;
zh( 2 ,1 ) =500 ;
z.h5 .data_bounds =zh;
end
//
if u27.value ==1 then
// frequenzaschse
z.h5 .x_ticks =tlist( [ 'locations ','labels '] ,[ 0 ,10 ,20 ,30 ,40 ,50 ,60 ,70 ,80 ,90 ,100 ,110 ,120 ,130 ,140 ,150 ,160 ,170 ,180 ,190 ,200 ,210 ,220 ,230 ,240 ,250 ] ,[ "0 ","10 ","20 ","30 ","40 ","50 ","60 ","70 ","80 ","90 ","100 ","110 ","120 ","130 ","140 ","150 ","160 ","170 ","180 ","190 ","200 ","210 ","220 ","230 ","240 ","250 "] ) ;
zh=z.h5 .data_bounds ;
//zh( 1 ,2 ) =0 ;
//zh( 2 ,2 ) =1000 ;
zh( 1 ,1 ) =0 ;
zh( 2 ,1 ) =250 ;
z.h5 .data_bounds =zh;
end
//
//
if u28.value ==1 then
// frequenzaschse
z.h5 .x_ticks =tlist( [ 'locations ','labels '] ,[ 0 ,10 ,20 ,30 ,40 ,50 ,60 ,70 ,80 ,90 ,100 ,110 ,120 ,130 ] ,[ "0 ","10 ","20 ","30 ","40 ","50 ","60 ","70 ","80 ","90 ","100 ","110 ","120 ","130 "] ) ;
zh=z.h5 .data_bounds ;
//zh( 1 ,2 ) =0 ;
//zh( 2 ,2 ) =1000 ;
zh( 1 ,1 ) =0 ;
zh( 2 ,1 ) =120 ;
z.h5 .data_bounds =zh;
end
if u29.value ==1 then
// frequenzaschse
z.h5 .x_ticks =tlist( [ 'locations ','labels '] ,[ 0 ,5 ,10 ,15 ,20 ,25 ,30 ,35 ,40 ,45 ,50 ,55 ,60 ] ,[ "0 ","5 ","10 ","15 ","20 ","25 ","30 ","35 ","40 ","45 ","50 ","55 ","60 "] ) ;
zh=z.h5 .data_bounds ;
//zh( 1 ,2 ) =0 ;
//zh( 2 ,2 ) =1000 ;
zh( 1 ,1 ) =0 ;
zh( 2 ,1 ) =60 ;
z.h5 .data_bounds =zh;
end
endfunction
////////////////////////////////////////////////////////////////////////////
// start
z.vs =1 ;
z.fo =250 ;
z.po =0 ;
//
z.fi =figure ( 'position ',[ 10 ,10 ,1400 ,900 ] ) ;
z.fi .background = 33 ;
z.fi .color_map = jetcolormap( 1000 ) ; //Colormap festlegen
z.fi .visible = "on";
z.fi .figure_name ="Signalanalyse";
z.fi .BackgroundColor =[ 1 1 1 ] ;
//z.tag ='Formular ';
// controls
u1=uicontrol ( z.fi ,"style","pushbutton", 'position ', [ 660 170 60 30 ] ,'string ','Neu ','callback ','[ z] =neudatei( z) ') ;
u3=uicontrol ( z.fi ,"style","text",'HorizontalAlignment ','center ' ,'position ', [ 660 285 60 30 ] ,'string ','0 ') ;
u4=uicontrol ( z.fi ,"style","text",'HorizontalAlignment ','center ' ,'position ', [ 660 265 60 30 ] ,'string ','Sekunden ') ;
u5=uicontrol ( z.fi ,"style","pushbutton", 'position ', [ 660 130 60 30 ] ,'string ','Exit ','callback ','close ') ;
u6=uicontrol ( z.fi ,"style","text",'HorizontalAlignment ','center ' ,'position ', [ 100 5 1200 30 ] ,'string ','') ;
u7=uicontrol ( z.fi ,"style","spinner", 'position ', [ 660 400 60 40 ] ,'HorizontalAlignment ','center ','VerticalAlignment ','middle ','min ',1 ,'max ',10 ,'SliderStep ',[ 1 ,10 ] ,'Title_position ','top ','callback ','[ z] =verst( z) ') ;
u8=uicontrol ( z.fi ,"style","text",'HorizontalAlignment ','center ' ,'position ', [ 660 440 60 20 ] ,'string ','Verstärkung ') ;
u9=uicontrol ( z.fi ,"style","spinner", 'position ', [ 660 330 60 40 ] ,'HorizontalAlignment ','center ','VerticalAlignment ','middle ','min ',1 ,'max ',250 ,'SliderStep ',[ 1 ,10 ] ,'Title_position ','top ','value ',250 ,'callback ','[ z] =fober( z) ') ;
u10=uicontrol ( z.fi ,"style","text",'HorizontalAlignment ','center ' ,'position ', [ 660 370 60 20 ] ,'string ','F max ( Hz) ') ;
u11=uicontrol ( z.fi ,"style","spinner", 'position ', [ 660 225 60 40 ] ,'HorizontalAlignment ','center ','VerticalAlignment ','middle ','min ',1 ,'max ',1 ,'SliderStep ',[ 1 ,10 ] ,'Title_position ','top ','callback ','[ z] =position( z) ') ;
//
u12=uicontrol ( z.fi ,"style","radiobutton",'groupname ','fenster3 ','HorizontalAlignment ','center ' ,'position ', [ 1325 820 60 20 ] ,'string ','100 % ','callback ','[ z] =fenster3( z) ') ;
u13=uicontrol ( z.fi ,"style","radiobutton",'groupname ','fenster3 ','HorizontalAlignment ','center ' ,'position ', [ 1325 780 60 20 ] ,'string ','50 % ','callback ','[ z] =fenster3( z) ') ;
u14=uicontrol ( z.fi ,"style","radiobutton",'groupname ','fenster3 ','HorizontalAlignment ','center ' ,'position ', [ 1325 740 60 20 ] ,'string ','25 % ','callback ','[ z] =fenster3( z) ') ;
u15=uicontrol ( z.fi ,"style","radiobutton",'groupname ','fenster3 ','HorizontalAlignment ','center ' ,'position ', [ 1325 700 60 20 ] ,'string ','10 % ','callback ','[ z] =fenster3( z) ') ;
u12.value =1 ;
///////////////
u16=uicontrol ( z.fi ,"style","radiobutton",'groupname ','fenster5 ','HorizontalAlignment ','center ' ,'position ', [ 1325 370 60 20 ] ,'string ','100 % ','callback ','[ z] =fenster5( z) ') ;
u17=uicontrol ( z.fi ,"style","radiobutton",'groupname ','fenster5 ','HorizontalAlignment ','center ' ,'position ', [ 1325 330 60 20 ] ,'string ','50 % ','callback ','[ z] =fenster5( z) ') ;
u18=uicontrol ( z.fi ,"style","radiobutton",'groupname ','fenster5 ','HorizontalAlignment ','center ' ,'position ', [ 1325 290 60 20 ] ,'string ','25 % ','callback ','[ z] =fenster5( z) ') ;
u19=uicontrol ( z.fi ,"style","radiobutton",'groupname ','fenster5 ','HorizontalAlignment ','center ' ,'position ', [ 1325 250 60 20 ] ,'string ','10 % ','callback ','[ z] =fenster5( z) ') ;
u16.value =1 ;
///////////////////////////////// frequenzen
//
u21=uicontrol ( z.fi ,"style","radiobutton",'groupname ','fenster3f ','HorizontalAlignment ','center ' ,'position ', [ 1325 660 60 20 ] ,'string ','500f ','callback ','[ z] =fenster3f( z) ') ;
u22=uicontrol ( z.fi ,"style","radiobutton",'groupname ','fenster3f ','HorizontalAlignment ','center ' ,'position ', [ 1325 620 60 20 ] ,'string ','250f ','callback ','[ z] =fenster3f( z) ') ;
u23=uicontrol ( z.fi ,"style","radiobutton",'groupname ','fenster3f ','HorizontalAlignment ','center ' ,'position ', [ 1325 580 60 20 ] ,'string ','120f ','callback ','[ z] =fenster3f( z) ') ;
u24=uicontrol ( z.fi ,"style","radiobutton",'groupname ','fenster3f ','HorizontalAlignment ','center ' ,'position ', [ 1325 540 60 20 ] ,'string ','60f ','callback ','[ z] =fenster3f( z) ') ;
u22.value =1 ;
//////////////////////////////////////
//
u26=uicontrol ( z.fi ,"style","radiobutton",'groupname ','fenster5f ','HorizontalAlignment ','center ' ,'position ', [ 1325 210 60 20 ] ,'string ','500f ','callback ','[ z] =fenster5f( z) ') ;
u27=uicontrol ( z.fi ,"style","radiobutton",'groupname ','fenster5f ','HorizontalAlignment ','center ' ,'position ', [ 1325 170 60 20 ] ,'string ','250f ','callback ','[ z] =fenster5f( z) ') ;
u28=uicontrol ( z.fi ,"style","radiobutton",'groupname ','fenster5f ','HorizontalAlignment ','center ' ,'position ', [ 1325 130 60 20 ] ,'string ','120f ','callback ','[ z] =fenster5f( z) ') ;
u29=uicontrol ( z.fi ,"style","radiobutton",'groupname ','fenster5f ','HorizontalAlignment ','center ' ,'position ', [ 1325 90 60 20 ] ,'string ','60f ','callback ','[ z] =fenster5f( z) ') ;
u27.value =1 ;
//////////////////////////////////////
//
//
z.h1 = newaxes( ) ;
z.h1 .axes_bounds = [ 0 ,0 ,0.5 ,0.5 ] ;
//
z.h2 = newaxes( ) ;
z.h2 .axes_bounds = [ 0.495 ,0 ,0.02 ,0.5 ] ;
//
z.h3 = newaxes( ) ;
z.h3 .axes_bounds = [ 0.5 ,0 ,0.5 ,0.5 ] ;
//
z.h4 = newaxes( ) ;
z.h4 .axes_bounds = [ 0 ,0.5 ,0.5 ,0.5 ] ;
//
z.h5 = newaxes( ) ;
z.h5 .axes_bounds = [ 0.5 ,0.5 ,0.5 ,0.5 ] ;
//
Einstellungen und Berechtigungen
Du kannst Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen. Du kannst Dateien in diesem Forum posten Du kannst Dateien in diesem Forum herunterladen
Impressum
| Nutzungsbedingungen
| Datenschutz
| FAQ
| RSS
Hosted by:
Copyright © 2007 - 2024
goMatlab.de | Dies ist keine offizielle Website der Firma The Mathworks
MATLAB, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, SimBiology, SimHydraulics, SimEvents, and xPC TargetBox are registered trademarks and The MathWorks, the L-shaped membrane logo, and Embedded MATLAB are trademarks of The MathWorks, Inc.