diff options
author | Erich Eckner <git@eckner.net> | 2017-12-12 15:13:48 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2017-12-12 15:13:48 +0100 |
commit | 7dc5be9cc445dec7dd7d3242642b77caf90c9527 (patch) | |
tree | 846749aeade7efd7ae4a14028c6b37d14147411c | |
parent | 94ee2a174a0504748acbe3dd9f07683c3e26360f (diff) | |
download | epost-7dc5be9cc445dec7dd7d3242642b77caf90c9527.tar.xz |
epostunit.pas: FFTs brauchen (zur Zeit) gerade Anzahlen von Werten - Fehler werfen, wenn ungerade Anzahlen gegeben werden.
-rw-r--r-- | epost.lps | 106 | ||||
-rw-r--r-- | epostunit.pas | 29 |
2 files changed, 80 insertions, 55 deletions
@@ -24,8 +24,8 @@ <IsPartOfProject Value="True"/> <IsVisibleTab Value="True"/> <EditorIndex Value="1"/> - <TopLine Value="6081"/> - <CursorPos X="69" Y="6105"/> + <TopLine Value="4850"/> + <CursorPos Y="4853"/> <UsageCount Value="201"/> <Loaded Value="True"/> </Unit2> @@ -40,8 +40,8 @@ <Filename Value="werteunit.pas"/> <IsPartOfProject Value="True"/> <EditorIndex Value="8"/> - <TopLine Value="68"/> - <CursorPos X="52" Y="84"/> + <TopLine Value="972"/> + <CursorPos X="41" Y="973"/> <UsageCount Value="200"/> <Loaded Value="True"/> </Unit4> @@ -67,7 +67,7 @@ <Filename Value="../units/fftunit.inc"/> <IsPartOfProject Value="True"/> <EditorIndex Value="4"/> - <TopLine Value="156"/> + <TopLine Value="168"/> <CursorPos X="56" Y="179"/> <UsageCount Value="202"/> <Loaded Value="True"/> @@ -86,7 +86,7 @@ <EditorIndex Value="9"/> <TopLine Value="407"/> <CursorPos X="114" Y="425"/> - <UsageCount Value="90"/> + <UsageCount Value="91"/> <Loaded Value="True"/> </Unit9> <Unit10> @@ -94,7 +94,7 @@ <EditorIndex Value="7"/> <TopLine Value="542"/> <CursorPos X="49" Y="566"/> - <UsageCount Value="46"/> + <UsageCount Value="47"/> <Loaded Value="True"/> </Unit10> <Unit11> @@ -118,7 +118,7 @@ <EditorIndex Value="2"/> <TopLine Value="126"/> <CursorPos X="7" Y="147"/> - <UsageCount Value="60"/> + <UsageCount Value="61"/> <Loaded Value="True"/> </Unit13> <Unit14> @@ -215,123 +215,123 @@ </Units> <JumpHistory Count="30" HistoryIndex="29"> <Position1> - <Filename Value="epost.lpr"/> - <Caret Line="439" Column="3" TopLine="418"/> + <Filename Value="epostunit.pas"/> + <Caret Line="8553" Column="16" TopLine="8540"/> </Position1> <Position2> - <Filename Value="epost.lpr"/> - <Caret Line="336" Column="98" TopLine="316"/> + <Filename Value="epostunit.pas"/> + <Caret Line="8575" Column="35" TopLine="8551"/> </Position2> <Position3> <Filename Value="epost.lpr"/> + <Caret Line="428" TopLine="418"/> </Position3> <Position4> <Filename Value="epostunit.pas"/> - <Caret Line="457" Column="78" TopLine="426"/> + <Caret Line="8575" Column="30" TopLine="8549"/> </Position4> <Position5> - <Filename Value="epostunit.pas"/> - <Caret Line="8571" TopLine="8536"/> + <Filename Value="../units/matheunit.pas"/> + <Caret Line="875" Column="71" TopLine="863"/> </Position5> <Position6> - <Filename Value="epostunit.pas"/> - <Caret Line="458" TopLine="455"/> + <Filename Value="epost.lpr"/> + <Caret Line="18" Column="7" TopLine="3"/> </Position6> <Position7> <Filename Value="epostunit.pas"/> - <Caret Line="8552" TopLine="8540"/> + <Caret Line="8567" Column="42" TopLine="8550"/> </Position7> <Position8> <Filename Value="epostunit.pas"/> - <Caret Line="8553" Column="16" TopLine="8540"/> + <Caret Line="2247" TopLine="2230"/> </Position8> <Position9> - <Filename Value="epostunit.pas"/> - <Caret Line="8575" Column="35" TopLine="8551"/> + <Filename Value="../units/mystringlistunit.pas"/> + <Caret Line="40" Column="26" TopLine="14"/> </Position9> <Position10> - <Filename Value="epost.lpr"/> - <Caret Line="428" TopLine="418"/> + <Filename Value="epostunit.pas"/> + <Caret Line="1348" Column="12" TopLine="1333"/> </Position10> <Position11> <Filename Value="epostunit.pas"/> - <Caret Line="8575" Column="30" TopLine="8549"/> + <Caret Line="5345" Column="43" TopLine="5329"/> </Position11> <Position12> - <Filename Value="../units/matheunit.pas"/> - <Caret Line="875" Column="71" TopLine="863"/> + <Filename Value="typenunit.pas"/> + <Caret Line="345" Column="14" TopLine="329"/> </Position12> <Position13> - <Filename Value="epost.lpr"/> - <Caret Line="18" Column="7" TopLine="3"/> + <Filename Value="typenunit.pas"/> + <Caret Line="283" Column="23" TopLine="275"/> </Position13> <Position14> <Filename Value="epostunit.pas"/> - <Caret Line="8567" Column="42" TopLine="8550"/> + <Caret Line="5348" Column="17" TopLine="5333"/> </Position14> <Position15> <Filename Value="epostunit.pas"/> - <Caret Line="2247" TopLine="2230"/> + <Caret Line="457" Column="25" TopLine="439"/> </Position15> <Position16> - <Filename Value="../units/mystringlistunit.pas"/> - <Caret Line="40" Column="26" TopLine="14"/> + <Filename Value="epostunit.pas"/> + <Caret Line="8588" TopLine="8561"/> </Position16> <Position17> <Filename Value="epostunit.pas"/> - <Caret Line="1348" Column="12" TopLine="1333"/> + <Caret Line="174" Column="22" TopLine="158"/> </Position17> <Position18> <Filename Value="epostunit.pas"/> - <Caret Line="5345" Column="43" TopLine="5329"/> + <Caret Line="4601" Column="43" TopLine="4584"/> </Position18> <Position19> - <Filename Value="typenunit.pas"/> - <Caret Line="345" Column="14" TopLine="329"/> + <Filename Value="epostunit.pas"/> + <Caret Line="457" Column="25" TopLine="439"/> </Position19> <Position20> - <Filename Value="typenunit.pas"/> - <Caret Line="283" Column="23" TopLine="275"/> + <Filename Value="../units/matheunit.pas"/> + <Caret Line="56" Column="25" TopLine="38"/> </Position20> <Position21> - <Filename Value="epostunit.pas"/> - <Caret Line="5348" Column="17" TopLine="5333"/> + <Filename Value="epost.lpr"/> + <Caret Line="428" Column="32" TopLine="399"/> </Position21> <Position22> - <Filename Value="epostunit.pas"/> - <Caret Line="457" Column="25" TopLine="439"/> + <Filename Value="epost.lpr"/> + <Caret Line="439" Column="37" TopLine="410"/> </Position22> <Position23> <Filename Value="epostunit.pas"/> - <Caret Line="8588" TopLine="8561"/> + <Caret Line="191" Column="26" TopLine="175"/> </Position23> <Position24> <Filename Value="epostunit.pas"/> - <Caret Line="174" Column="22" TopLine="158"/> + <Caret Line="6105" Column="69" TopLine="6076"/> </Position24> <Position25> <Filename Value="epostunit.pas"/> - <Caret Line="4601" Column="43" TopLine="4584"/> + <Caret Line="6093" Column="35" TopLine="6080"/> </Position25> <Position26> <Filename Value="epostunit.pas"/> - <Caret Line="457" Column="25" TopLine="439"/> + <Caret Line="177" Column="25" TopLine="161"/> </Position26> <Position27> - <Filename Value="../units/matheunit.pas"/> - <Caret Line="56" Column="25" TopLine="38"/> + <Filename Value="werteunit.pas"/> + <Caret Line="58" Column="36" TopLine="50"/> </Position27> <Position28> - <Filename Value="epost.lpr"/> - <Caret Line="428" Column="32" TopLine="399"/> + <Filename Value="epostunit.pas"/> + <Caret Line="4973" Column="58" TopLine="4964"/> </Position28> <Position29> - <Filename Value="epost.lpr"/> - <Caret Line="439" Column="37" TopLine="410"/> + <Filename Value="epostunit.pas"/> </Position29> <Position30> <Filename Value="epostunit.pas"/> - <Caret Line="191" Column="26" TopLine="175"/> + <Caret Line="177" Column="25" TopLine="149"/> </Position30> </JumpHistory> </ProjectSession> diff --git a/epostunit.pas b/epostunit.pas index 704956e..390da27 100644 --- a/epostunit.pas +++ b/epostunit.pas @@ -4849,10 +4849,22 @@ begin exit; until false; bekannteBefehle.free; - if senkrecht then + if senkrecht then begin + if odd(_tSiz) then begin + gibAus('Eine FFT braucht eine gerade Anzahl an Werten, '+intToStr(_tSiz)+' ist aber ungerade (man könnte das aber auch noch implementieren)!',3); + fenster.free; + exit; + end; fenster.breite:=_tSiz - fenster.rand - else + end + else begin + if odd(_xSteps) then begin + gibAus('Eine FFT braucht eine gerade Anzahl an Werten, '+intToStr(_xSteps)+' ist aber ungerade (man könnte das aber auch noch implementieren)!',3); + fenster.free; + exit; + end; fenster.breite:=_xSteps - fenster.rand; + end; if not sT then begin gibAus('berechne FFT ...',3); if not fft(threads,senkrecht,false,doRes,nB,fenster,nil,pvFehler,warn) then begin @@ -4956,6 +4968,19 @@ begin fensters[true].breite:=_tSiz-fensters[true].breite; fensters[false].breite:=_xSteps-fensters[false].breite; + if odd(_tSiz) then begin + gibAus('Eine 2d-FFT braucht eine gerade Anzahl an Werten, '+intToStr(_tSiz)+' ist aber ungerade (man könnte das aber auch noch implementieren)!',3); + for b:=false to true do + fensters[b].free; + exit; + end; + if odd(_xSteps) then begin + gibAus('Eine 2d-FFT braucht eine gerade Anzahl an Werten, '+intToStr(_xSteps)+' ist aber ungerade (man könnte das aber auch noch implementieren)!',3); + for b:=false to true do + fensters[b].free; + exit; + end; + if istKomplex xor (dos[4] in [doAlleResIms, doAlleResSmi]) then begin gibAus('Eine 2d-FFT gibt genau dann alle Real- und Imaginärteile aus, wenn die Eingabe komplex ist!',3); exit; |