projects
/
ctsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r9247: Automated commit for ctsim debian-version-4.3.1-2
[ctsim.git]
/
src
/
views.cpp
diff --git
a/src/views.cpp
b/src/views.cpp
index 2273a87fc089e2007a3bd90ad282f2ce8137e5f9..1fe4bbfbbc2c71facb551f464b64bc7dec8a4b36 100644
(file)
--- a/
src/views.cpp
+++ b/
src/views.cpp
@@
-9,7
+9,7
@@
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id
: views.cpp,v 1.172 2003/03/23 18:37:42 kevin Exp
$
+** $Id$
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
@@
-1560,19
+1560,19
@@
ImageFileView::OnPlotFFTRow (wxCommandEvent& event)
int ny = rIF.ny();
if (v != NULL && yCursor < ny) {
int ny = rIF.ny();
if (v != NULL && yCursor < ny) {
- fftw_complex* pcIn =
new fftw_complex [nx]
;
+ fftw_complex* pcIn =
static_cast<fftw_complex*>(fftw_malloc (sizeof(fftw_complex) * nx))
;
int i;
for (i = 0; i < nx; i++) {
int i;
for (i = 0; i < nx; i++) {
- pcIn[i]
.re
= v[i][yCursor];
+ pcIn[i]
[0]
= v[i][yCursor];
if (rIF.isComplex())
if (rIF.isComplex())
- pcIn[i]
.im
= vImag[i][yCursor];
+ pcIn[i]
[1]
= vImag[i][yCursor];
else
else
- pcIn[i]
.im
= 0;
+ pcIn[i]
[1]
= 0;
}
}
- fftw_plan plan = fftw_
create_plan (nx, FFTW_FORWARD, FFTW_IN_PLACE | FFTW_ESTIMATE | FFTW_USE_WISDOM
);
- fftw_
one (plan, pcIn, NULL
);
+ fftw_plan plan = fftw_
plan_dft_1d (nx, pcIn, pcIn, FFTW_FORWARD, FFTW_ESTIMATE
);
+ fftw_
execute (plan
);
fftw_destroy_plan (plan);
double* pX = new double [nx];
fftw_destroy_plan (plan);
double* pX = new double [nx];
@@
-1581,9
+1581,9
@@
ImageFileView::OnPlotFFTRow (wxCommandEvent& event)
double* pYMag = new double [nx];
for (i = 0; i < nx; i++) {
pX[i] = i;
double* pYMag = new double [nx];
for (i = 0; i < nx; i++) {
pX[i] = i;
- pYReal[i] = pcIn[i]
.re
/ nx;
- pYImag[i] = pcIn[i]
.im
/ nx;
- pYMag[i] = ::sqrt (pcIn[i]
.re * pcIn[i].re + pcIn[i].im * pcIn[i].im
);
+ pYReal[i] = pcIn[i]
[0]
/ nx;
+ pYImag[i] = pcIn[i]
[1]
/ nx;
+ pYMag[i] = ::sqrt (pcIn[i]
[0] * pcIn[i][0] + pcIn[i][1] * pcIn[i][1]
);
}
Fourier::shuffleFourierToNaturalOrder (pYReal, nx);
Fourier::shuffleFourierToNaturalOrder (pYImag, nx);
}
Fourier::shuffleFourierToNaturalOrder (pYReal, nx);
Fourier::shuffleFourierToNaturalOrder (pYImag, nx);
@@
-1628,7
+1628,7
@@
ImageFileView::OnPlotFFTRow (wxCommandEvent& event)
delete pYReal;
delete pYImag;
delete pYMag;
delete pYReal;
delete pYImag;
delete pYMag;
-
delete [] pcIn
;
+
fftw_free(pcIn)
;
if (theApp->getAskDeleteNewDocs())
pPlotDoc->Modify (true);
if (theApp->getAskDeleteNewDocs())
pPlotDoc->Modify (true);
@@
-1662,7
+1662,7
@@
ImageFileView::OnPlotFFTCol (wxCommandEvent& event)
pdTemp[i] = v[xCursor][i];
Fourier::shuffleNaturalToFourierOrder (pdTemp, ny);
for (i = 0; i < ny; i++)
pdTemp[i] = v[xCursor][i];
Fourier::shuffleNaturalToFourierOrder (pdTemp, ny);
for (i = 0; i < ny; i++)
- pcIn[i]
.re
= pdTemp[i];
+ pcIn[i]
[0]
= pdTemp[i];
for (i = 0; i < ny; i++) {
if (rIF.isComplex())
for (i = 0; i < ny; i++) {
if (rIF.isComplex())
@@
-1672,10
+1672,10
@@
ImageFileView::OnPlotFFTCol (wxCommandEvent& event)
}
Fourier::shuffleNaturalToFourierOrder (pdTemp, ny);
for (i = 0; i < ny; i++)
}
Fourier::shuffleNaturalToFourierOrder (pdTemp, ny);
for (i = 0; i < ny; i++)
- pcIn[i]
.im
= pdTemp[i];
+ pcIn[i]
[1]
= pdTemp[i];
- fftw_plan plan = fftw_
create_plan (ny, FFTW_BACKWARD, FFTW_IN_PLACE | FFTW_ESTIMATE | FFTW_USE_WISDOM
);
- fftw_
one (plan, pcIn, NULL
);
+ fftw_plan plan = fftw_
plan_dft_1d (ny, pcIn, pcIn, FFTW_BACKWARD, FFTW_ESTIMATE
);
+ fftw_
execute (plan
);
fftw_destroy_plan (plan);
double* pX = new double [ny];
fftw_destroy_plan (plan);
double* pX = new double [ny];
@@
-1684,9
+1684,9
@@
ImageFileView::OnPlotFFTCol (wxCommandEvent& event)
double* pYMag = new double [ny];
for (i = 0; i < ny; i++) {
pX[i] = i;
double* pYMag = new double [ny];
for (i = 0; i < ny; i++) {
pX[i] = i;
- pYReal[i] = pcIn[i]
.re
/ ny;
- pYImag[i] = pcIn[i]
.im
/ ny;
- pYMag[i] = ::sqrt (pcIn[i]
.re * pcIn[i].re + pcIn[i].im * pcIn[i].im
);
+ pYReal[i] = pcIn[i]
[0]
/ ny;
+ pYImag[i] = pcIn[i]
[1]
/ ny;
+ pYMag[i] = ::sqrt (pcIn[i]
[0] * pcIn[i][0] + pcIn[i][1] * pcIn[i][1]
);
}
PlotFileDocument* pPlotDoc = theApp->newPlotDoc();
}
PlotFileDocument* pPlotDoc = theApp->newPlotDoc();