Corrected ambiguity with the centre frequency content of the 'gaussiandotdot' and 'gaussiandotnorm' waveforms. Prior to this update the centre frequency of these waveforms were derived from a base Gaussian waveform with the user given frequency (deriving the pulse width), i.e. this resulted in higher than expected centre frequencies for these waveforms. This has now been corrected so that the user specified centre frequency is what is used for these waveforms.

Tidied up terminology relating to waveform centre frequency.
这个提交包含在:
Craig Warren
2017-06-09 15:57:35 +01:00
父节点 90f7255ff0
当前提交 2e4b43df0f
共有 4 个文件被更改,包括 12 次插入12 次删除

查看文件

@@ -664,10 +664,10 @@ Allows you to specify waveforms to use with sources in the model. The syntax of
* ``sine`` which is a single cycle of a sine waveform.
* ``contsine`` which is a continuous sine waveform. In order to avoid introducing noise into the calculation the amplitude of the waveform is modulated for the first cycle of the sine wave (ramp excitation).
* ``f1`` is the scaling of the maximum amplitude of the waveform (for a ``#hertzian_dipole`` the units will be Amps, for a ``#voltage_source`` or ``#transmission_line`` the units will be Volts).
* ``f2`` is the frequency of the waveform (Hertz).
* ``f2`` is the centre frequency of the waveform (Hertz). In the case of the Gaussian waveform it is related to the pulse width.
* ``str2`` is an identifier for the waveform used to assign it to a source.
For example, to specify a Gaussian waveform with an amplitude of one and a centre frequency of 1.2 GHz, use: ``#waveform: gaussian 1 1.2e9 my_gauss_pulse``.
For example, to specify the normalised first derivate of a Gaussian waveform with an amplitude of one and a centre frequency of 1.2GHz, use: ``#waveform: gaussiandotnorm 1 1.2e9 my_gauss_pulse``.
.. note::

查看文件

@@ -96,9 +96,9 @@ where:
* ``type`` is the type of waveform, e.g. gaussian, ricker etc...
* ``amp`` is the amplitude of the waveform
* ``freq`` is the centre frequency of the waveform
* ``timewindow`` is the time window to view the waveform, i.e. the time window of the proposed simulation
* ``dt`` is the time step to view waveform, i.e. the time step of the proposed simulation
* ``freq`` is the centre frequency of the waveform (Hertz). In the case of the Gaussian waveform it is related to the pulse width.
* ``timewindow`` is the time window (seconds) to view the waveform, i.e. the time window of the proposed simulation
* ``dt`` is the time step (seconds) to view waveform, i.e. the time step of the proposed simulation
There is an optional command line argument:
@@ -107,7 +107,7 @@ There is an optional command line argument:
Definitions
-----------
Definitions of the built-in waveforms and example plots are shown using the parameters: amplitude of one, frequency of 1GHz, time window of 6ns, and a time step of 1.926ps.
Definitions of the built-in waveforms and example plots are shown using the parameters: amplitude of one, centre frequency of 1GHz, time window of 6ns, and a time step of 1.926ps.
gaussian
^^^^^^^^

查看文件

@@ -45,11 +45,11 @@ class Waveform(object):
"""
# Coefficients for certain waveforms
if self.type == 'gaussian' or self.type == 'gaussiandot' or self.type == 'gaussiandotdot':
if self.type == 'gaussian' or self.type == 'gaussiandot' or self.type == 'gaussiandotnorm':
chi = 1 / self.freq
zeta = 2 * np.pi**2 * self.freq**2
delay = time - chi
elif self.type == 'gaussiandotnorm' or self.type == 'gaussiandotdotnorm' or self.type == 'ricker':
elif self.type == 'gaussiandotdot' or self.type == 'gaussiandotdotnorm' or self.type == 'ricker':
chi = np.sqrt(2) / self.freq
zeta = np.pi**2 * self.freq**2
delay = time - chi

查看文件

@@ -92,13 +92,13 @@ def mpl_plot(w, timewindow, dt, iterations, fft=False):
print('Maximum amplitude: {:g}'.format(w.amp))
if w.freq:
if w.freq and not w.type == 'gaussian':
print('Centre frequency: {:g} Hz'.format(w.freq))
if w.type == 'gaussian' or w.type == 'gaussiandot' or w.type == 'gaussiandotdot':
if w.type == 'gaussian' or w.type == 'gaussiandot' or w.type == 'gaussiandotnorm':
delay = 1 / w.freq
print('Time to centre of pulse: {:g} s'.format(delay))
elif w.type == 'gaussiandotnorm' or w.type == 'gaussiandotdotnorm' or w.type == 'ricker':
elif w.type == 'gaussiandotdot' or w.type == 'gaussiandotdotnorm' or w.type == 'ricker':
delay = np.sqrt(2) / w.freq
print('Time to centre of pulse: {:g} s'.format(delay))
@@ -107,7 +107,7 @@ def mpl_plot(w, timewindow, dt, iterations, fft=False):
powerdrop = -3 # dB
start = np.where((10 * np.log10(waveform / np.amax(waveform))) > powerdrop)[0][0]
stop = np.where((10 * np.log10(waveform[start:] / np.amax(waveform))) < powerdrop)[0][0] + start
print('Pulse width at {:d}dB, i.e. FWHM: {:g} s'.format(powerdrop, time[stop] - time[start]))
print('Pulse width at {:d}dB, i.e. full width at half maximum (FWHM): {:g} s'.format(powerdrop, time[stop] - time[start]))
print('Time window: {:g} s ({} iterations)'.format(timewindow, iterations))
print('Time step: {:g} s'.format(dt))