diff options
author | Erich Eckner <git@eckner.net> | 2017-07-21 10:50:20 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2017-07-21 10:50:20 +0200 |
commit | 0f1d4a00485da9604a79d8f73da7bce079a412bb (patch) | |
tree | 2bdd4a0f67a1921132ec04cbd42cca121e5f1dfe | |
parent | f009e113f88bea65eaa2a48350dbfd83fdd3e02a (diff) | |
download | epost-0f1d4a00485da9604a79d8f73da7bce079a412bb.tar.xz |
epostunit.pas: tFFTThread kann jetzt auch 2dfft mit doAlleResIms und doAlleResSmi richtig
-rw-r--r-- | epost.lps | 115 | ||||
-rw-r--r-- | epostunit.pas | 46 |
2 files changed, 89 insertions, 72 deletions
@@ -24,8 +24,8 @@ <IsPartOfProject Value="True"/> <IsVisibleTab Value="True"/> <EditorIndex Value="1"/> - <TopLine Value="441"/> - <CursorPos X="74" Y="467"/> + <TopLine Value="5772"/> + <CursorPos X="42" Y="5801"/> <UsageCount Value="201"/> <Loaded Value="True"/> </Unit2> @@ -40,8 +40,8 @@ <Filename Value="werteunit.pas"/> <IsPartOfProject Value="True"/> <EditorIndex Value="6"/> - <TopLine Value="1383"/> - <CursorPos X="26" Y="1407"/> + <TopLine Value="1086"/> + <CursorPos X="32" Y="1114"/> <UsageCount Value="200"/> <Loaded Value="True"/> </Unit4> @@ -58,18 +58,17 @@ <Filename Value="../units/fftunit.pas"/> <IsPartOfProject Value="True"/> <EditorIndex Value="2"/> - <TopLine Value="55"/> - <CursorPos X="126" Y="71"/> - <UsageCount Value="183"/> + <TopLine Value="220"/> + <UsageCount Value="189"/> <Loaded Value="True"/> </Unit6> <Unit7> <Filename Value="../units/fftunit.inc"/> <IsPartOfProject Value="True"/> <EditorIndex Value="3"/> - <TopLine Value="133"/> - <CursorPos X="99" Y="152"/> - <UsageCount Value="180"/> + <TopLine Value="162"/> + <CursorPos X="12" Y="191"/> + <UsageCount Value="186"/> <Loaded Value="True"/> </Unit7> <Unit8> @@ -77,7 +76,7 @@ <IsPartOfProject Value="True"/> <EditorIndex Value="7"/> <CursorPos X="35" Y="10"/> - <UsageCount Value="86"/> + <UsageCount Value="92"/> <Loaded Value="True"/> </Unit8> <Unit9> @@ -99,7 +98,7 @@ <EditorIndex Value="5"/> <TopLine Value="449"/> <CursorPos X="22" Y="469"/> - <UsageCount Value="72"/> + <UsageCount Value="75"/> <Loaded Value="True"/> </Unit11> <Unit12> @@ -112,7 +111,7 @@ <EditorIndex Value="4"/> <TopLine Value="517"/> <CursorPos X="21" Y="393"/> - <UsageCount Value="46"/> + <UsageCount Value="49"/> <Loaded Value="True"/> </Unit13> <Unit14> @@ -127,7 +126,7 @@ <EditorIndex Value="-1"/> <TopLine Value="182"/> <CursorPos X="21" Y="202"/> - <UsageCount Value="0"/> + <UsageCount Value="10"/> </Unit15> <Unit16> <Filename Value="/usr/lib/fpc/src/rtl/unix/bunxovlh.inc"/> @@ -203,121 +202,121 @@ <JumpHistory Count="30" HistoryIndex="29"> <Position1> <Filename Value="werteunit.pas"/> - <Caret Line="1369" Column="32" TopLine="1340"/> + <Caret Line="1074" Column="103" TopLine="1058"/> </Position1> <Position2> - <Filename Value="werteunit.pas"/> + <Filename Value="../units/fftunit.inc"/> + <Caret Line="214" TopLine="195"/> </Position2> <Position3> - <Filename Value="werteunit.pas"/> - <Caret Line="65" Column="83" TopLine="37"/> + <Filename Value="../units/fftunit.inc"/> + <Caret Line="229" Column="9" TopLine="195"/> </Position3> <Position4> - <Filename Value="werteunit.pas"/> - <Caret Line="1381" Column="39" TopLine="1361"/> + <Filename Value="../units/fftunit.pas"/> + <Caret Line="469" Column="69" TopLine="450"/> </Position4> <Position5> - <Filename Value="werteunit.pas"/> - <Caret Line="65" Column="91" TopLine="49"/> + <Filename Value="../units/fftunit.inc"/> + <Caret Line="126" Column="23" TopLine="103"/> </Position5> <Position6> <Filename Value="epostunit.pas"/> - <Caret Line="5625" Column="94" TopLine="5600"/> + <Caret Line="5794" Column="51" TopLine="5779"/> </Position6> <Position7> <Filename Value="epostunit.pas"/> - <Caret Line="5550" TopLine="5548"/> </Position7> <Position8> <Filename Value="epostunit.pas"/> - <Caret Line="245" Column="41" TopLine="234"/> + <Caret Line="153" Column="17" TopLine="125"/> </Position8> <Position9> <Filename Value="epostunit.pas"/> - <Caret Line="5550" Column="73" TopLine="5532"/> + <Caret Line="2856" Column="20" TopLine="2827"/> </Position9> <Position10> <Filename Value="epostunit.pas"/> - <Caret Line="254" Column="252" TopLine="236"/> + <Caret Line="2869" Column="23" TopLine="2840"/> </Position10> <Position11> <Filename Value="epostunit.pas"/> - <Caret Line="4570" Column="150" TopLine="4552"/> + <Caret Line="3329" Column="15" TopLine="3301"/> </Position11> <Position12> <Filename Value="epostunit.pas"/> - <Caret Line="5650" Column="107" TopLine="5625"/> + <Caret Line="3753" Column="13" TopLine="3725"/> </Position12> <Position13> <Filename Value="epostunit.pas"/> + <Caret Line="3759" Column="13" TopLine="3731"/> </Position13> <Position14> <Filename Value="epostunit.pas"/> - <Caret Line="245" Column="38" TopLine="216"/> + <Caret Line="3783" Column="13" TopLine="3755"/> </Position14> <Position15> <Filename Value="epostunit.pas"/> - <Caret Line="2863" Column="65" TopLine="2834"/> + <Caret Line="3789" Column="13" TopLine="3761"/> </Position15> <Position16> - <Filename Value="epostunit.pas"/> - <Caret Line="4213" Column="24" TopLine="4184"/> + <Filename Value="../units/fftunit.inc"/> + <Caret Line="120" TopLine="106"/> </Position16> <Position17> - <Filename Value="epostunit.pas"/> - <Caret Line="4277" Column="10" TopLine="4249"/> + <Filename Value="../units/fftunit.inc"/> + <Caret Line="180" Column="83" TopLine="166"/> </Position17> <Position18> - <Filename Value="epostunit.pas"/> - <Caret Line="4344" Column="29" TopLine="4331"/> + <Filename Value="../units/fftunit.inc"/> </Position18> <Position19> - <Filename Value="epostunit.pas"/> - <Caret Line="4345" Column="14" TopLine="4331"/> + <Filename Value="../units/fftunit.inc"/> + <Caret Line="170" Column="36" TopLine="142"/> </Position19> <Position20> - <Filename Value="epostunit.pas"/> - <Caret Line="4368" Column="17" TopLine="4358"/> + <Filename Value="../units/fftunit.inc"/> + <Caret Line="116" Column="11" TopLine="87"/> </Position20> <Position21> - <Filename Value="epostunit.pas"/> - <Caret Line="4494" Column="43" TopLine="4484"/> + <Filename Value="../units/fftunit.inc"/> + <Caret Line="191" Column="11" TopLine="168"/> </Position21> <Position22> - <Filename Value="epostunit.pas"/> - <Caret Line="4490" Column="34" TopLine="4485"/> + <Filename Value="../units/fftunit.inc"/> + <Caret Column="23"/> </Position22> <Position23> - <Filename Value="epostunit.pas"/> - <Caret Line="5642" TopLine="5626"/> + <Filename Value="werteunit.pas"/> + <Caret Line="1039" Column="69" TopLine="1031"/> </Position23> <Position24> - <Filename Value="epostunit.pas"/> - <Caret Line="241" Column="13" TopLine="231"/> + <Filename Value="werteunit.pas"/> + <Caret Line="1112" Column="52" TopLine="1083"/> </Position24> <Position25> - <Filename Value="epostunit.pas"/> - <Caret Line="4212" Column="64" TopLine="4183"/> + <Filename Value="werteunit.pas"/> + <Caret Line="87" TopLine="86"/> </Position25> <Position26> - <Filename Value="epostunit.pas"/> - <Caret Line="4570" Column="36" TopLine="4542"/> + <Filename Value="werteunit.pas"/> + <Caret Line="1115" Column="24" TopLine="1086"/> </Position26> <Position27> - <Filename Value="werteunit.pas"/> - <Caret Line="1378" Column="32" TopLine="1361"/> + <Filename Value="epostunit.pas"/> + <Caret Line="3923" Column="113" TopLine="3903"/> </Position27> <Position28> <Filename Value="epostunit.pas"/> - <Caret Line="5649" Column="33" TopLine="5615"/> + <Caret Line="5784" Column="12" TopLine="5755"/> </Position28> <Position29> <Filename Value="epostunit.pas"/> - <Caret Line="5645" TopLine="5628"/> + <Caret Line="5783" Column="12" TopLine="5754"/> </Position29> <Position30> <Filename Value="epostunit.pas"/> - <Caret Line="41" Column="20" TopLine="23"/> + <Caret Line="5801" Column="46" TopLine="5772"/> </Position30> </JumpHistory> </ProjectSession> diff --git a/epostunit.pas b/epostunit.pas index efdb914..07e921a 100644 --- a/epostunit.pas +++ b/epostunit.pas @@ -2856,7 +2856,7 @@ end; function tWerte.fft(threads: longint; senkrecht,invers: boolean; const vor,nach: tFFTDatenordnung; fen: tFenster; hg: extended; out pvFehler: extended; Warn: tWarnstufe): boolean; var fftThreads: array of tFFTThread; - i: int64; + i,fftTSiz: int64; fertig: boolean; begin result:=false; @@ -2869,11 +2869,12 @@ begin gibAus('tWerte.fft kann nicht mit getrenntem Input oder Output umgehen!',3); exit; end; + fftTSiz:=_tSiz div (1+byte(vor in [doAlleResIms,doAlleResSmi])); if senkrecht then begin if assigned(fen) and - (length(fen.werte)<>_tSiz) then - fen.berechneWerte(_tSiz); + (length(fen.werte)<>fftTSiz) then + fen.berechneWerte(fftTSiz); if threads>_xSteps then threads:=_xSteps; end @@ -2881,8 +2882,8 @@ begin if assigned(fen) and (length(fen.werte)<>_xSteps) then fen.berechneWerte(_xSteps); - if threads>_tSiz then - threads:=_tSiz; + if threads>fftTSiz then + threads:=fftTSiz; end; setLength(fftThreads,threads); @@ -2915,7 +2916,7 @@ begin tFFTThread.create( self, 0, - round(_tSiz/threads-1), + round(fftTSiz/threads-1), senkrecht, invers, vor, @@ -2926,8 +2927,8 @@ begin fftThreads[i]:= tFFTThread.create( self, - round(_tSiz/threads*i), - round(_tSiz/threads*(i+1)-1), + round(fftTSiz/threads*i), + round(fftTSiz/threads*(i+1)-1), senkrecht, invers, fftThreads[0].algo, @@ -3803,6 +3804,7 @@ var bekannteBefehle: tMyStringList; maxPos: tIntPoint; betraege: tWerte; + i,j: int64; begin result:=false; Zeit:=now; @@ -3883,14 +3885,14 @@ begin gibAus(' (Parseval-Fehler = '+floatToStr(pvFehler)+')',3); for b:=false to true do fensters[b].free; - +(* gibAus('spektrale Beträge ermitteln',3); betraege:=tWerte.create(self,0,_xSteps-1); betraege.fft2dNachbearbeitung(threads,doBetrQdr); - + *) fft2dNachbearbeitung(threads,doAlleResIms); - gibAus('tiefe Frequenzen filtern',3); +(* gibAus('tiefe Frequenzen filtern',3); case genauigkeit of gSingle: sWerte.kantenFilter(betraege.sWerte,xFak,yFak,kfHochpass,true,maxPos); @@ -3898,8 +3900,8 @@ begin dWerte.kantenFilter(betraege.dWerte,xFak,yFak,kfHochpass,true,maxPos); gExtended: eWerte.kantenFilter(betraege.eWerte,xFak,yFak,kfHochpass,true,maxPos); - end{of case}; - betraege.free; + end{of case}; *) +// betraege.free; gibAus('berechne inverse x-FFT ...',3); if not fft(threads,false,true,doAlleResIms,doAlleResIms,nil,0,pvFehler,wsLasch) then begin @@ -3913,6 +3915,22 @@ begin exit; end; gibAus(' (Parseval-Fehler = '+floatToStr(pvFehler)+')',3); + + hintergrund:=0; + for i:=_tSiz div 2 +1 to _tSiz-1 do + for j:=0 to _xSteps-1 do + hintergrund:=hintergrund + sqr(eWerte.werte[j+i*_xSteps]); + + writeln(hintergrund,' ',_xSteps*_tSiz div 2,' ',hintergrund*2/_xSteps/_tSiz); + + pvFehler:=0; + for i:=0 to _tSiz div 2 do + for j:=0 to _xSteps-1 do + pvFehler:=pvFehler + sqr(eWerte.werte[j+i*_xSteps]); + +// _tSiz:=_tSiz div 2; +// holeRAM(3); + gibAus('... fertig '+timetostr(now-Zeit),3); result:=true; end; @@ -5771,7 +5789,7 @@ begin if senkrecht then tmpFFTAlgo:=createFFTAlgorithmus(werte._tSiz div (1+byte(halberInput)),vor,nach) else - tmpFFTAlgo:=createFFTAlgorithmus(werte._xSteps div (1+byte(halberInput)),vor,nach); + tmpFFTAlgo:=createFFTAlgorithmus(werte._xSteps,vor,nach); create(werte,sMin,sMax,senkrecht,invers,tmpFFTAlgo,fenster,hintergrund); tmpFFTAlgo.free; end; |