kopia lustrzana https://github.com/f4exb/sdrangel
				
				
				
			Added decimation class with unsigned to signed conversion with shift. Applied to RTL-SDR
							rodzic
							
								
									18fa3b6156
								
							
						
					
					
						commit
						c7e1526930
					
				| 
						 | 
					@ -88,7 +88,7 @@ void RTLSDRThread::run()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//  Decimate according to specified log2 (ex: log2=4 => decim=16)
 | 
					//  Decimate according to specified log2 (ex: log2=4 => decim=16)
 | 
				
			||||||
void RTLSDRThread::callback(const qint8* buf, qint32 len)
 | 
					void RTLSDRThread::callback(const quint8* buf, qint32 len)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	SampleVector::iterator it = m_convertBuffer.begin();
 | 
						SampleVector::iterator it = m_convertBuffer.begin();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -178,9 +178,6 @@ void RTLSDRThread::callback(const qint8* buf, qint32 len)
 | 
				
			||||||
void RTLSDRThread::callbackHelper(unsigned char* buf, uint32_t len, void* ctx)
 | 
					void RTLSDRThread::callbackHelper(unsigned char* buf, uint32_t len, void* ctx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	RTLSDRThread* thread = (RTLSDRThread*)ctx;
 | 
						RTLSDRThread* thread = (RTLSDRThread*)ctx;
 | 
				
			||||||
	for (unsigned int i = 0; i < len; i++) {
 | 
						thread->callback(buf, len);
 | 
				
			||||||
	    buf[i] = buf[i] - 127;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	thread->callback((qint8 *) buf, len);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -24,7 +24,7 @@
 | 
				
			||||||
#include <rtl-sdr.h>
 | 
					#include <rtl-sdr.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "dsp/samplesinkfifo.h"
 | 
					#include "dsp/samplesinkfifo.h"
 | 
				
			||||||
#include "dsp/decimators.h"
 | 
					#include "dsp/decimatorsu.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class RTLSDRThread : public QThread {
 | 
					class RTLSDRThread : public QThread {
 | 
				
			||||||
	Q_OBJECT
 | 
						Q_OBJECT
 | 
				
			||||||
| 
						 | 
					@ -52,10 +52,10 @@ private:
 | 
				
			||||||
	unsigned int m_log2Decim;
 | 
						unsigned int m_log2Decim;
 | 
				
			||||||
	int m_fcPos;
 | 
						int m_fcPos;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	Decimators<qint8, SDR_SAMP_SZ, 8> m_decimators;
 | 
						DecimatorsU<quint8, SDR_SAMP_SZ, 8, 127> m_decimators;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	void run();
 | 
						void run();
 | 
				
			||||||
	void callback(const qint8* buf, qint32 len);
 | 
						void callback(const quint8* buf, qint32 len);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	static void callbackHelper(unsigned char* buf, uint32_t len, void* ctx);
 | 
						static void callbackHelper(unsigned char* buf, uint32_t len, void* ctx);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -96,6 +96,7 @@ set(sdrbase_HEADERS
 | 
				
			||||||
    dsp/cwkeyer.h
 | 
					    dsp/cwkeyer.h
 | 
				
			||||||
    dsp/cwkeyersettings.h
 | 
					    dsp/cwkeyersettings.h
 | 
				
			||||||
    dsp/decimators.h
 | 
					    dsp/decimators.h
 | 
				
			||||||
 | 
					    dsp/decimatorsu.h
 | 
				
			||||||
    dsp/interpolators.h
 | 
					    dsp/interpolators.h
 | 
				
			||||||
    dsp/dspcommands.h
 | 
					    dsp/dspcommands.h
 | 
				
			||||||
    dsp/dspengine.h
 | 
					    dsp/dspengine.h
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
										
											
												Plik diff jest za duży
												Load Diff
											
										
									
								
							
		Ładowanie…
	
		Reference in New Issue