Пример #1
0
        /// <summary>
        /// Function for retrieving the Noise blanker settings.
        /// </summary>
        /// <returns>Returns <see cref="Devices.NoiseBlanker"/> settings.</returns>
        public NoiseBlanker NoiseBlanker()
        {
            uint threshold = default(uint);
            var  active    = G313DemodulatorApi.GetNoiseBlanker(GetHandle(), ref threshold);

            return(new NoiseBlanker {
                Active = active, Threshold = threshold
            });
        }
Пример #2
0
        /// <summary>
        /// Function for retrieving the IF notch filter settings.
        /// </summary>
        /// <returns>Returns <see cref="Devices.NotchFilter"/> settings.</returns>
        public NotchFilter NotchFilter()
        {
            uint bandwidth = default(uint);
            int  frequency = default(int);
            var  active    = G313DemodulatorApi.GetNotchFilter(GetHandle(), ref frequency, ref bandwidth);

            return(new NotchFilter {
                Bandwidth = bandwidth, Frequency = frequency, Active = active
            });
        }
Пример #3
0
        /// <summary>
        /// Function for activating the IF and audio streams while the demodulator is active.
        /// </summary>
        /// <returns>Returns <see cref="G313Demodulator"/></returns>
        public G313Demodulator SetupStreams()
        {
            var result = G313DemodulatorApi.SetupStreams(GetHandle(), _ifCallback, IntPtr.Zero, _audioCallback, IntPtr.Zero);

            if (!result)
            {
                throw new OperationFailedException("failed to setup audio streams", _parent);
            }

            return(this);
        }
Пример #4
0
        /// <summary>
        /// Function for retrieving the software Automatic gain control settings.
        /// </summary>
        /// <returns>Returns <see cref="Devices.SoftwareAgc"/> settings.</returns>
        public SoftwareAgc SoftwareAgc()
        {
            var agc    = new NativeDefinitions.SoftAgcData();
            var result = G313DemodulatorApi.GetSoftAGC(GetHandle(), ref agc);

            if (!result)
            {
                throw new OperationFailedException("failed to retrieve software Agc", _parent);
            }

            return(new SoftwareAgc().FillManged(agc));
        }
Пример #5
0
 /// <summary>
 /// Function for retrieving the Passband offset value.
 /// </summary>
 /// <returns>Returns passband offset value.</returns>
 public int PassbandOffset()
 {
     return(G313DemodulatorApi.GetPassbandOffset(GetHandle()));
 }
Пример #6
0
 /// <summary>
 /// Function for retrieving the IF bandwidth value.
 /// </summary>
 /// <returns>Returns If bandwidth value.</returns>
 public uint IfBandwidth()
 {
     return(G313DemodulatorApi.GetIFBandwidth(GetHandle()));
 }
Пример #7
0
 /// <summary>
 /// Function for setting the desired AGC behaviour. The AGC is active for as long as the reference level is below 0. The attack and decay times are automatically set to 1 if the values passed to the API are 0.
 /// </summary>
 /// <param name="agc"><see cref="Devices.SoftwareAgc"/> Gain control parameters</param>
 /// <returns>Returns true if parametars are set.</returns>
 public bool TrySoftwareAgc(SoftwareAgc agc)
 {
     return(G313DemodulatorApi.SetSoftAGC(GetHandle(), agc.ToNative()));
 }
Пример #8
0
 /// <summary>
 /// Function for getting the tuning error after the demodulator has been initialized. The resulting value is valid only if the receiver is tuned to a transmissions. The returned value must be substracted from the frequency to which the receiver is currently tuned.
 /// </summary>
 /// <returns>Returns tune error value.</returns>
 public int TuneError()
 {
     return(G313DemodulatorApi.GetTuneError(GetHandle()));
 }
Пример #9
0
 /// <summary>
 /// Function for getting the current ISB audio channel.
 /// </summary>
 /// <returns>Returns current channel.</returns>
 public IsbAudioChannels IsbAudioChannel()
 {
     return((IsbAudioChannels)G313DemodulatorApi.GetISBAudioChannel(GetHandle()));
 }
Пример #10
0
 /// <summary>
 /// Function for retrieving the audition volume value.
 /// </summary>
 /// <returns>Returns audition volume value</returns>
 public uint Volume()
 {
     return(G313DemodulatorApi.GetVolume(GetHandle()));
 }
Пример #11
0
 /// <summary>
 /// Function for retrieving the audio bandwidth value.
 /// </summary>
 /// <returns>Returns audio bandwidth value</returns>
 public uint AudioBandwidth()
 {
     return(G313DemodulatorApi.GetAudioBandwidth(GetHandle()));
 }
Пример #12
0
 /// <summary>
 /// Function for setting the AF squelch while demodulating FM transmissions. The level corresponds to the minimum noise level that will mute the audio output. By specifying a value of 0 the AF squelch is disabled.
 /// </summary>
 /// <param name="level">Specified squelch level.</param>
 /// <returns>Returns true if the specified squelch level is set.</returns>
 public bool TryAfSquelchLevel(uint level)
 {
     return(G313DemodulatorApi.SetFMAFSquelchLevel(GetHandle(), level));
 }
Пример #13
0
 /// <summary>
 /// Function for setting the audition volume. It can be any value between 0 and 31.
 /// </summary>
 /// <param name="volume">Specified audition volume.</param>
 /// <returns>Returns true if the specified audition volume is set.</returns>
 public bool TryVolume(uint volume)
 {
     CheckVolume(volume);
     return(G313DemodulatorApi.SetVolume(GetHandle(), volume));
 }
Пример #14
0
 /// <summary>
 /// Function for setting the fixed audio gain. This value is used to provide a fixed audio amplification when the software AGC is disabled.
 /// </summary>
 /// <param name="gain">Specified audio gain.</param>
 /// <returns>Returns true if the specified audio gain is set.</returns>
 public bool TryAudioGain(uint gain)
 {
     return(G313DemodulatorApi.SetAudioGain(GetHandle(), gain));
 }
Пример #15
0
 /// <summary>
 /// Function for setting the final audio bandwidth. For linear modulation types it should be equal to IF bandwidth (LSB, USB) or half the IF bandwidth (AM, AMS, DSB, ISB). For exponential modulations (FM) it is transmission dependant. For CW there is a special condition as the audio bandwidth should be the minimum between half IF bandwidth and the CW tone frequency.
 /// </summary>
 /// <param name="bandwidth">Specified audio bandwidth.</param>
 /// <returns>Returns true if the Specified audio bandwidth is set.</returns>
 public bool TryAudioBandwidth(uint bandwidth)
 {
     return(G313DemodulatorApi.SetAudioBandwidth(GetHandle(), bandwidth));
 }
Пример #16
0
 /// <summary>
 /// Function for selecting the desired demodulation mode. All demodulation modes available in the G313 demodulator can be selected here. The codes for the modes are the corresponding XRS codes RADIOMODE_xxx.
 /// </summary>
 /// <param name="mode"><see cref="DemodulatorMode"/> Specified mode.</param>
 /// <returns>Returns true if the specified mode is set.</returns>
 public bool TryMode(DemodulatorMode mode)
 {
     return(G313DemodulatorApi.SetMode(GetHandle(), (G313Definitions.G313Mode)mode));
 }
Пример #17
0
 /// <summary>
 /// Disables Software based automatic gain control.
 /// </summary>
 /// <returns>Returns true if the feature is disabled.</returns>
 public bool TryDisableSoftwareAgc()
 {
     return(G313DemodulatorApi.SetSoftAGC(GetHandle(), new SoftwareAgc().ToNative()));
 }
Пример #18
0
 /// <summary>
 ///Function for specifying the audio channel that should be sent to the audio output when demodulating ISB transmissions. 0 stands for Left (LSB) and 1 for Right (USB).
 /// </summary>
 /// <param name="channel"><see cref="IsbAudioChannels"/> Specified audio channel.</param>
 /// <returns>Returns true if the specified audio channel is set.</returns>
 public bool TryIsbAudioChannel(IsbAudioChannels channel)
 {
     return(G313DemodulatorApi.SetISBAudioChannel(GetHandle(), (uint)channel));
 }
Пример #19
0
 /// <summary>
 /// Function for getting the current demodulation mode.
 /// </summary>
 /// <returns>Returns <see cref="DemodulatorMode"/> current mode.</returns>
 public DemodulatorMode Mode()
 {
     return((DemodulatorMode)G313DemodulatorApi.GetMode(GetHandle()));
 }
Пример #20
0
 /// <summary>
 /// Function for setting the frequency of the audible tone when receving CW transmissions.
 /// </summary>
 /// <param name="frequency">Specified tone frequency.</param>
 /// <returns>Returns true if the specified value is set.</returns>
 public bool TryCwTone(uint frequency)
 {
     return(G313DemodulatorApi.SetCWTone(GetHandle(), frequency));
 }
Пример #21
0
 /// <summary>
 /// Function for retrieving the audio gain value.
 /// </summary>
 /// <returns>Returns audio gain value</returns>
 public uint AudioGain()
 {
     return(G313DemodulatorApi.GetAudioGain(GetHandle()));
 }
Пример #22
0
 /// <summary>
 /// Function for setting the IF bandwidth. Values in the 1Hz...15kHz range are accepted. Through this API call the filters that come after the I and Q multipliers are controlled.
 /// </summary>
 /// <param name="bandwidth">bandwidth value</param>
 /// <returns>Returns true if If bandwidth value is set.</returns>
 /// <exception cref="ArgumentOutOfRangeException">Throws if If bandwidth value is out of range.</exception>
 public bool TryIfBandwidth(uint bandwidth)
 {
     CheckIfBandwidth(bandwidth);
     return(G313DemodulatorApi.SetIFBandwidth(GetHandle(), bandwidth));
 }
Пример #23
0
 /// <summary>
 /// Function for getting the current FM AF squelch level.
 /// </summary>
 /// <returns>Returns current squlech level</returns>
 public uint AfSquelchLevel()
 {
     return(G313DemodulatorApi.GetFMAFSquelchLevel(GetHandle()));
 }
Пример #24
0
 /// <summary>
 /// Function for getting the AM depth for the current transmission. The 0..1 range normal for this parameter is returned scaled to 0..1000.
 /// </summary>
 /// <returns>returns depth value.</returns>
 public uint AmDepth()
 {
     return(G313DemodulatorApi.GetAMDepth(GetHandle()));
 }
Пример #25
0
 /// <summary>
 /// Function for getting the current CW tone frequency.
 /// </summary>
 /// <returns>Returns current frequency.</returns>
 public uint CwTone()
 {
     return(G313DemodulatorApi.GetCWTone(GetHandle()));
 }
Пример #26
0
 /// <summary>
 /// Function for setting the IF shift. The specified value is added to the IF2 frequency and provides the actual receiving frequency. The resulting value must not exceed the IF hardware filter bandwidth (15kHz for G313), thus the accepted values are in the range -7500...+7500.
 /// </summary>
 /// <param name="shift">Shift value.</param>
 /// <returns>Returns true if If shift value is set.</returns>
 /// <exception cref="ArgumentOutOfRangeException">Throws if If shift value is out of range.</exception>
 public bool TryIfShift(int shift)
 {
     CheckIfShift(shift);
     return(G313DemodulatorApi.SetIFShift(GetHandle(), shift));
 }
Пример #27
0
 /// <summary>
 /// Function for getting the frequency deviation (in Hz) of the currently received transmission.
 /// </summary>
 /// <returns>Returns frequency deviations.</returns>
 public uint FrequencyDeviations()
 {
     return(G313DemodulatorApi.GetFrequencyDeviation(GetHandle()));
 }
Пример #28
0
 /// <summary>
 /// Function for setting the pass-band offset value. Normally it is 0. Accepted values are from -8kHz...+8kHz. It controls the amount that the spectrum is shifted before actual demodulation.
 /// </summary>
 /// <param name="offset">Offset value</param>
 /// <returns>Return true if passband offset is set.</returns>
 /// <exception cref="ArgumentOutOfRangeException">Throws if Passband offset value is out of range.</exception>
 public bool TryPassbandOffset(int offset)
 {
     CheckPassbandOffset(offset);
     return(G313DemodulatorApi.SetPassbandOffset(GetHandle(), offset));
 }
Пример #29
0
 /// <summary>
 /// Function for retrieving the IF shift value.
 /// </summary>
 /// <returns>Returns If shift value.</returns>
 public int IfShift()
 {
     return(G313DemodulatorApi.GetIFShift(GetHandle()));
 }
Пример #30
0
 /// <summary>
 /// Function for configuring the noise blanker
 /// </summary>
 /// <param name="noiseBlanker"><see cref="Devices.NoiseBlanker"/> Blanker parameters</param>
 /// <returns>Return true if Noise blanker parameters are set.</returns>
 public bool TryNoiseBlanker(NoiseBlanker noiseBlanker)
 {
     return(G313DemodulatorApi.SetNoiseBlanker(GetHandle(), noiseBlanker.Active, (uint)noiseBlanker.Threshold));
 }