| 39 | } |
| 40 | |
| 41 | bool |
| 42 | ExportSamplesTask::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 | |
| 71 | bool |
| 72 | ExportSamplesTask::exportToMat5(void) |