- squelch uses linear gain, no dB

- peak mamanger commands gain 0 oer 1.0



git-svn-id: http://moon:8086/svn/software/trunk/projects/GnuRadio@507 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2019-05-29 14:39:54 +00:00
parent 2d656e14fc
commit 880e46bce9
2 changed files with 6 additions and 7 deletions
+1 -2
View File
@@ -87,8 +87,7 @@ namespace gr {
// Check pair for data
if (pmt::symbol_to_string(key) == std::string("gain"))
{
float gain_dB = pmt::to_float(val) - 50.f;
m_gain_target = std::pow(10.f, gain_dB/10);
m_gain_target = pmt::to_float(val);
}
}
+5 -5
View File
@@ -108,8 +108,8 @@ class peak_manager(gr.basic_block):
if peakMsg['state'] == 1:
if peakEntry is not None:
msg_dict = pmt.make_dict()
msg_dict = pmt.dict_add(msg_dict, pmt.intern("freq"), pmt.from_double(peakMsg['freq_Hz']))
msg_dict = pmt.dict_add(msg_dict, pmt.intern("gain"), pmt.from_double(-peakMsg['height']))
msg_dict = pmt.dict_add(msg_dict, pmt.intern("freq"), pmt.from_float(peakMsg['freq_Hz']))
msg_dict = pmt.dict_add(msg_dict, pmt.intern("gain"), pmt.from_float(1.0))
portname = peakEntry['port_name']
self.message_port_pub(pmt.intern(portname), msg_dict)
print ("Updated peak #{} at {:0.2f} MHz on port {}".format(id, freq_MHz, portname))
@@ -117,14 +117,14 @@ class peak_manager(gr.basic_block):
peakEntry = self.peak_add(peak_key, peakMsg)
if peakEntry is not None:
msg_dict = pmt.make_dict()
msg_dict = pmt.dict_add(msg_dict, pmt.intern("freq"), pmt.from_double(peakMsg['freq_Hz']))
msg_dict = pmt.dict_add(msg_dict, pmt.intern("gain"), pmt.from_double(-peakMsg['height']))
msg_dict = pmt.dict_add(msg_dict, pmt.intern("freq"), pmt.from_float(peakMsg['freq_Hz']))
msg_dict = pmt.dict_add(msg_dict, pmt.intern("gain"), pmt.from_float(1.0))
portname = peakEntry['port_name']
self.message_port_pub(pmt.intern(portname), msg_dict)
print ("New peak #{} at {:0.2f} MHz on port {}".format(id, freq_MHz, portname))
else:
if peakEntry is not None:
pair = pmt.cons(pmt.intern("gain"), pmt.from_float(-120.0))
pair = pmt.cons(pmt.intern("gain"), pmt.from_float(0.0))
portname = peakEntry['port_name']
self.message_port_pub(pmt.intern(portname), pair)
if self.peak_del(peak_key):