10 fSize = (size_t) roundl(duration*samplFreq);
16 fRCFreq = 1./(tauRC*2*M_PI) * duration;
19 double norm = 2.703395061;
22 QVector besselSestoRe(
fSize), besselSestoIm(
fSize);
24 QVector transFunctionRe(
fSize), transFunctionIm(
fSize);
26 for(
size_t x = 0; x<
fSize/2 + 1; x++) {
28 double valBesselRe = 10395. - 4725.*
pow(xx,2) + 210.*
pow(xx,4) -
pow(xx,6);
29 double valBesselIm =xx*( 10395.-1260.*
pow(xx,2)+21.*
pow(xx,4));
30 besselSestoRe(x) = 10395. * valBesselRe/(
pow(valBesselRe,2)+
pow(valBesselIm,2));
31 besselSestoIm(x) = -10395. * valBesselIm/(
pow(valBesselRe,2)+
pow(valBesselIm,2));
33 double xxrc = double(x)/
fRCFreq;
34 rcRe(x) = 1./(1.+
pow(xxrc,2));
35 rcIm(x) = -xxrc/(1.+
pow(xxrc,2));
39 for(
size_t y = 0; y<(
fSize/2-1); y++) {
40 double xx = - (
fSize/2-1 - y);
42 double valBesselRe= 10395. - 4725.*
pow(xx,2) + 210.*
pow(xx,4) -
pow(xx,6);
43 double valBesselIm=xx*( 10395.-1260.*
pow(xx,2)+21.*
pow(xx,4));
44 besselSestoRe(y+
fSize/2+1) = 10395.*valBesselRe/(
pow(valBesselRe,2)+
pow(valBesselIm,2));
45 besselSestoIm(y+
fSize/2+1) = -10395.*valBesselIm/(
pow(valBesselRe,2)+
pow(valBesselIm,2));
48 rcRe(y+
fSize/2+1) = 1./(1.+
pow(xxrc,2));
49 rcIm(y+
fSize/2+1) = -xxrc/(1.+
pow(xxrc,2));
53 for(
size_t x = 0; x <
fSize; x++) {
55 transFunctionRe[x] = besselSestoRe[x]*rcRe[x] - besselSestoIm[x]*rcIm[x];
56 transFunctionIm[x] = besselSestoRe[x]*rcIm[x] + besselSestoIm[x]*rcRe[x];
58 transFunctionIm[x] = besselSestoIm[x];
59 transFunctionRe[x] = besselSestoRe[x];
72 while(newsize <
fSize) {
76 QVector deltaResponsez(newsize);
80 deltaResponsez_second.
GetVector().Initialize(0.);
94 fAphi[0] = 0.8675096732313656;
95 fAp[0] = 10.959228792517152;
96 fAq[0] = 39.425157113160175;
98 fAphi[1] = 2.6262723114471256;
99 fAp[1] = -14.126767991748853;
100 fAq[1] = -12.701164165560234;
101 fAtheta[2] = 2.5159322478108215;
102 fAphi[2] = 4.492672953653942;
103 fAp[2] = 3.1675391992317308;
104 fAq[2] = 0.2024589840416812;
112 for(
size_t k = 0; k <
fAN; k++) {
127 if(t <= t_0)
return 0;
131 for(
size_t k = 0; k <
fAN; k++) {
132 double c =
fAphi[k] * omz;
135 double alpha = -
fAtheta[k] * omz;
136 double alphatau = alpha - 1./tau;
137 double sina =
sin(c*zs)*(p*c + q*alphatau);
138 double cosa =
cos(c*zs)*(p*alphatau - q*c);
139 double sx =
exp(zs*alphatau)*(sina + cosa);
140 double dx = q*c - p*alphatau;
141 result += (sx + dx) / (c*c + alphatau*alphatau);
143 result *= 2*omz *
exp((t-t_0)/tau);
152 signal.Resize(
fSize);
154 size_t t_g_max =
fSize - 1;;
156 for(
unsigned int t = 0; t <
fSize; t++) {
160 if(t< t_min + t_g_min) {
continue;}
161 else if (t >= t_g_min + t_min && t< t_min + t_g_max) {
164 }
else if (t>= t_min + t_g_max && t <= t_g_min + t_max) {
168 }
else if (t > t_g_min + t_max && t <= t_max + t_g_max) {
173 for(
int m = t_inf; m <= t_sup; m++) {
199 QVector pulseVec(
fSize);
200 for(
size_t i = 0; i <
fSize; i++) {
202 pulseVec[i] = (*pulse)(&convT);
209 QVector pulseVec(
fSize);
210 for(
size_t i = 0; i <
fSize; i++) {
212 pulseVec[i] = (*pulse)(&convT);
220 QVector pulseVec(
fSize);
221 for(
size_t i = 0; i <
fSize; i++) {
223 pulseVec[i] = (*func)(&convT,param);
231 QVector pulseVec(
fSize);
232 for(
size_t i = 0; i <
fSize; i++) {
234 pulseVec[i] = (*func)(&convT,param);
247 while(newsize <
fSize) {
251 QVector pulsez(newsize);
254 pulsez_first.
GetVector().Initialize(pulse[0]);
262 QVector signalz(newsize);
Diana::QComplex pow(const Diana::QComplex &z, double a)
Raise a complex number to a real power.
Diana::QVector sin(const Diana::QVector &v)
Diana::QVector cos(const Diana::QVector &v)
Diana::QVector exp(const Diana::QVector &v)
error class with error type and description
Wrapper for a specific QRealComplexFFT algorithm class.
virtual int TransformFromFreq(const QVectorC &FT, QVector &spectrum, bool compress=false)
transform from the frequencies to the times
virtual int TransformToFreq(const QVector &data, QVectorC &FFT, bool compress=false)
transform from the times to the frequencies
subview of an existing QVector, useful to operate on a QVector slice
QVector & GetVector() const
Get subview QVector.