QRSS Rx Network receiver. A receiver to sample a segment of RF spectrum and send this data to a server for further processing and display. NXP mbed Design Challenge entry (Honorable Mention). Published in Circuit Cellar, Feb 2012
Dependencies: NetServices mbed DNSResolver
DSP.h@0:82ff15078322, 2012-01-25 (annotated)
- Committer:
- claytong
- Date:
- Wed Jan 25 20:32:53 2012 +0000
- Revision:
- 0:82ff15078322
1.0 (initial public release)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
claytong | 0:82ff15078322 | 1 | /*--------------------------------------------------------------------------- |
claytong | 0:82ff15078322 | 2 | |
claytong | 0:82ff15078322 | 3 | QRSS Receiver Application |
claytong | 0:82ff15078322 | 4 | |
claytong | 0:82ff15078322 | 5 | by Clayton ZL3TKA/VK1TKA |
claytong | 0:82ff15078322 | 6 | clayton@isnotcrazy.com |
claytong | 0:82ff15078322 | 7 | |
claytong | 0:82ff15078322 | 8 | Header File for DSP Processing class |
claytong | 0:82ff15078322 | 9 | |
claytong | 0:82ff15078322 | 10 | ---------------------------------------------------------------------------*/ |
claytong | 0:82ff15078322 | 11 | #ifndef _DSP_H |
claytong | 0:82ff15078322 | 12 | #define _DSP_H |
claytong | 0:82ff15078322 | 13 | |
claytong | 0:82ff15078322 | 14 | #include "mbed.h" |
claytong | 0:82ff15078322 | 15 | #include "BufferSys.h" |
claytong | 0:82ff15078322 | 16 | |
claytong | 0:82ff15078322 | 17 | // Definitions |
claytong | 0:82ff15078322 | 18 | |
claytong | 0:82ff15078322 | 19 | // Macros |
claytong | 0:82ff15078322 | 20 | |
claytong | 0:82ff15078322 | 21 | // |
claytong | 0:82ff15078322 | 22 | // Classes |
claytong | 0:82ff15078322 | 23 | // |
claytong | 0:82ff15078322 | 24 | |
claytong | 0:82ff15078322 | 25 | //--------------------------------------------------------------------------- |
claytong | 0:82ff15078322 | 26 | // |
claytong | 0:82ff15078322 | 27 | // DSP Processor Class - based on a buffer handle. Processes the attached samples buffer |
claytong | 0:82ff15078322 | 28 | // |
claytong | 0:82ff15078322 | 29 | class TDSPProcessor : public TBufferHandle |
claytong | 0:82ff15078322 | 30 | { |
claytong | 0:82ff15078322 | 31 | |
claytong | 0:82ff15078322 | 32 | // parameters |
claytong | 0:82ff15078322 | 33 | public: |
claytong | 0:82ff15078322 | 34 | // Set NCO phase inc |
claytong | 0:82ff15078322 | 35 | // Set inc directly |
claytong | 0:82ff15078322 | 36 | void NCOPhaseInc( uint32_t uiPhaseInc ) |
claytong | 0:82ff15078322 | 37 | { uiMixerPhaseIncrement = uiPhaseInc; } |
claytong | 0:82ff15078322 | 38 | // Set inc from a frequency |
claytong | 0:82ff15078322 | 39 | void NCOFrequency( int32_t iFreq ); |
claytong | 0:82ff15078322 | 40 | |
claytong | 0:82ff15078322 | 41 | // results |
claytong | 0:82ff15078322 | 42 | public: |
claytong | 0:82ff15078322 | 43 | // get filtered output data |
claytong | 0:82ff15078322 | 44 | const TDataSample FilteredOutput( int iIndex ) const |
claytong | 0:82ff15078322 | 45 | { |
claytong | 0:82ff15078322 | 46 | if ( !HasBuffer() || (iIndex<0) || (iIndex>=LPF_OUTPUTS_SIZE) ) |
claytong | 0:82ff15078322 | 47 | return NullSample; // return empty sample |
claytong | 0:82ff15078322 | 48 | return asLPFOutputs[iIndex]; |
claytong | 0:82ff15078322 | 49 | } |
claytong | 0:82ff15078322 | 50 | |
claytong | 0:82ff15078322 | 51 | // processing operations |
claytong | 0:82ff15078322 | 52 | public: |
claytong | 0:82ff15078322 | 53 | // Reset processing |
claytong | 0:82ff15078322 | 54 | void Reset(); |
claytong | 0:82ff15078322 | 55 | |
claytong | 0:82ff15078322 | 56 | // Mix samples with LO |
claytong | 0:82ff15078322 | 57 | bool MixLO(); |
claytong | 0:82ff15078322 | 58 | |
claytong | 0:82ff15078322 | 59 | // LPF processing |
claytong | 0:82ff15078322 | 60 | bool LPF(); |
claytong | 0:82ff15078322 | 61 | |
claytong | 0:82ff15078322 | 62 | // data |
claytong | 0:82ff15078322 | 63 | protected: |
claytong | 0:82ff15078322 | 64 | // NCO mixer |
claytong | 0:82ff15078322 | 65 | uint32_t uiMixerPhaseAccumulator; |
claytong | 0:82ff15078322 | 66 | uint32_t uiMixerPhaseIncrement; |
claytong | 0:82ff15078322 | 67 | |
claytong | 0:82ff15078322 | 68 | // LPF outputs |
claytong | 0:82ff15078322 | 69 | TDataSample asLPFOutputs[LPF_OUTPUTS_SIZE]; |
claytong | 0:82ff15078322 | 70 | |
claytong | 0:82ff15078322 | 71 | // LPF partial results (ready to complete with the next buffer) |
claytong | 0:82ff15078322 | 72 | TLongDataSample asLPFPartials[LPF_OUTPUTS_SIZE]; |
claytong | 0:82ff15078322 | 73 | |
claytong | 0:82ff15078322 | 74 | // LPF Partials valid flag |
claytong | 0:82ff15078322 | 75 | bool bLPFPartailsValid; |
claytong | 0:82ff15078322 | 76 | |
claytong | 0:82ff15078322 | 77 | }; |
claytong | 0:82ff15078322 | 78 | |
claytong | 0:82ff15078322 | 79 | #endif |
claytong | 0:82ff15078322 | 80 | |
claytong | 0:82ff15078322 | 81 | //--------------------------------------------------------------------------- |
claytong | 0:82ff15078322 | 82 | // END |
claytong | 0:82ff15078322 | 83 | //--------------------------------------------------------------------------- |
claytong | 0:82ff15078322 | 84 |