MCPcopy Create free account
hub / github.com/BatchDrake/SigDigger / exportToMatlab

Method exportToMatlab

Tasks/ExportSamplesTask.cpp:41–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41bool
42ExportSamplesTask::exportToMatlab(void)
43{
44 size_t size = this->data.size();
45
46 of << "%\n";
47 of << "% Time domain capture file generated by SigDigger\n";
48 of << "%\n\n";
49
50 of << "sampleRate = " << this->fs << ";\n";
51 of << "deltaT = " << 1 / this->fs << ";\n";
52 of << "X = [ ";
53
54 of << std::setprecision(std::numeric_limits<float>::digits10);
55
56
57 for (size_t i = 0; !this->cancelFlag && i < size; ++i) {
58 of
59 << SU_C_REAL(this->data[i]) << " + "
60 << SU_C_IMAG(this->data[i]) << "i, ";
61
62 if (i % SIGDIGGER_EXPORT_SAMPLES_BREATHE_BLOCK_SIZE == 0)
63 this->breathe(i);
64 }
65
66 of << "];\n";
67
68 return true;
69}
70
71bool
72ExportSamplesTask::exportToMat5(void)

Callers 1

workMethod · 0.95

Calls 2

breatheMethod · 0.95
sizeMethod · 0.45

Tested by

no test coverage detected