while True: While total_sample.shape ==1000: sample = get_sample(sample_factor) total_sample.append(sample) sample, dec_sample_r = decimate_and_filter(correct_dc_offset(total_sample) sample = squelch(sample) sample = sync_complex_signals(sample) el_demodulator(sample, dec_sample_rate)
def squelch(sample): # filter out the active signal from idle noice by taking the absolute # value of sample. sample_mag = np.abs(sample) #setting the threshold in magnitude sample_mag_thrs =squelch_value #0.003 sample_indices = np.nonzero(sample_mag >sample_mag_thrs)[0] #limit the sample to signals within the sample_indices return sample[np.min(sample_indices) : np.max(sample_indices)] #DEMOD SIGNAL def sync_complex_signals(sample): # demodulating fm signal with the two complex number sample_angle_diff = np.angle(sample[:-1] * np.conj(sample[1:])) #erease the diff between them return sample_angle_diff - np.mean(sample_angle_diff)
Flashback finansieras genom donationer från våra medlemmar och besökare. Det är med hjälp av dig vi kan fortsätta erbjuda en fri samhällsdebatt. Tack för ditt stöd!
Swish: 123 536 99 96 Bankgiro: 211-4106
Flashback finansieras genom donationer från våra medlemmar och besökare. Det är med hjälp av dig vi kan fortsätta erbjuda en fri samhällsdebatt. Tack för ditt stöd!
Swish: 123 536 99 96 Bankgiro: 211-4106