signalprocessing

Signal translation and clean up for spidyan

Syntax
x = signalprocessing(TimeAxis,RawSignal,FreqTranslation)

Description

With signalprocessing, it is possible to frequency translate signals generated by spidyan manually or if after a long simulation automatic signal processing failed. Signals that are detected in the simulation or lab frame contain a high-frequency component. By translating/shifting the frequency, it is possible to center the signal around 0, which corresponds to detection in the rotating frame. If the digital demodulation fails, the original signal is returned and the encountered error is displayed in the console. Some common error messages are described below. For each signal, a demodulation frequency in GHz needs to be provided.

Outputs

The output is the signal after frequency translation. If the input was a cell array, the output is a cell array and if the input is a numeric array, the output is a numeric array.

Input

TimeAxis
Time axis of the input signal in microseconds, as returned saffron and spidyan. Has to be the same data type as the signal.
RawSignal
Original signal, as returned by saffron and spidyan. Unless the signal has been modified after generation with spidyan, signalprocessing will correctly process the signal structure.
FreqTranslation
Vector containing the frequencies in GHz for translation. The indexing corresponds to the individual signals in RawSignal, e.g. the second element in FreqTranslation is the demodulation frequency for the second signal. Keep in mind that, if you detect a signal with Ŝ+, you will want to shift your signal down to zero frequency and hence use a negative frequency. If you use Ŝ-, your signal will oscillate at a negative frequency and you will want to shift it up to zero frequency and use a positive frequency.

Important: If Opt.FrameShift is being used during the spidyan simulation (see there) and demodulation is done manually, the frameshift has to be taken into account. E.g. if you simulate at Q-band frequencies (33.5 GHz) and use Opt.FrameShift = 32, density matrices are propagated at 1.5 GHz instead of 33.5 GHz and your signal will contain a frequency component of 1.5 GHz. The input for FreqTranslation hence needs to be 1.5 GHz and not 33.5 GHz.

Example

Before calling signalprocessing, a signal needs to be obtained. This is done by running a simulation with spidyan. Here, a slightly adapted version of the example given in the documentation for adiabatic passage of an electron spin S = 1/2. More on how to design pulse experiments with spidyan can be found on its man page.

Sys.S = 1/2;
Sys.ZeemanFreq = 33.500;

Pulse.Type = 'quartersin/linear';
Pulse.trise = 0.015;
Pulse.Qcrit = 10;

Exp.t = 0.2; 
Exp.Pulses = {Pulse};
Exp.Field = 1240; 
Exp.TimeStep = 0.00001; 
Exp.Frequency = [-0.100 0.100];
Exp.mwFreq = 33.5;
Exp.DetEvents = 1;

Opt.DetOperator = {'z1','+1'};

In contrast to the original example, Opt.FreqTranslation was omitted, which would demodulate the signal automatically. Therefore, plotting the signal now reveals the high frequency oscillation of the expectation value of Ŝ+:

figure(1)
clf
plot(TimeAxis*1000,real(Signal));
xlabel('t [ns]')
axis tight
ylim([-1 1])
ylabel('S_i')
legend(Opt.DetOperator)

To clean up the signal, signalprocessing has to be called with the correct frequencies for demodulation. Ŝz is not modulated and therefore does not need to be translated:

FreqTranslation = [0 -33.5];

ProcessedSignal = signalprocessing(TimeAxis,Signal,FreqTranslation)

figure(2)
clf
plot(TimeAxis*1000,real(ProcessedSignal));
xlabel('t [ns]')
axis tight
ylim([-1 1])
ylabel('S_i')
legend(Opt.DetOperator)

The same results can be obtained through demodulating the signal internally in spidyan by adding FreqTranslation to the Opt structure before running the simulation:

Opt.FreqTranslation = [0 -33.5];

[TimeAxis, Signal] = spidyan(Sys,Exp,Opt);

figure(3)
clf
plot(TimeAxis*1000,real(Signal));
xlabel('t [ns]')
axis tight
ylim([-1 1])
ylabel('S_i')
legend(Opt.DetOperator)
Common Error Messages

See also

saffron, spidyan