Second build sold out. Message will appear here when store is ready for third build ordering.

Measuring the AM Modulation in the AM and AMN Mode

Hi KiwiSDR users,
I have been using the kiwirecorder to record the RSSI and audio samples of AM signals. This all works very nicely. But would like also like calculate the AM Modulation of the Signal. How well is the AM signal being modulated? or over modulated. I tried to measure the RSSI of the USB and LSB in the AM Mode but this gives no RSSI reading.
Is anyone doing AM Modulation Measurements?
Or a any ideas on how this could be done?
Thanks.

Comments

  • Jimo
  • Thank you. Let me look at these. :)
  • edited May 2020
    I am wondering the same thing. I want to somehow measure the AM Modulation Index but I'm not quite sure how I could do that with the tools above. @WA2ZKD
  • Will there potentially be a way to monitor this directly with kiwirecorder?
  • the index must be calculated pre-detectio and would need a contant single tone I think
  • What is the use of the SAM detector? Could this be used for this purpose?
  • Seem to be making some progress .. Thank you. I am using the kiwirecorder to record the IQ Data as a *.WAV file.
    Is there somewhere where the details on the structure of the IQ Data WAV stream is documented?
  • Yes, look at Wikipedia for example. But a better question is how are you manipulating the wav file? Are you going to use a programming language? If so there are likely already library routines to operate on wav format files and read their content into a data array for you.
  • @jks yes we are looking to use a programming language, ideally python. I also have been checking out the read_kiwi_iq_wav.cc which seems like it could be helpful.

    The most important question is will the wav file have the data we need? Does it only store the audio information, or does it also contain the signal data that would allow us to see and measure the modulation?
  • jksjks
    edited June 2020
    I think this is more complicated than I originally thought. I skimmed the references Jim gave above and was reminded that modulation index is a comparison of the amplitude of the low-frequency (i.e. audio frequency) components to the carrier. So for that you cannot use the Kiwi audio stream after demodulation by the AM mode detector because that process filters out the carrier. That's what AM detection is by definition.

    I assume you're interested in this because you want to know if the stations in your network are modulating properly, e.g. using the transmitter power efficiently and also not over-modulating causing interference outside their assigned channel.

    So the question now becomes can you do this with a mode that preserves the carrier? I think this could be a side-band or IQ mode tuned "off channel" so that the carrier and one signal side-band go through the passband of the Kiwi resulting in an audio stream containing both carrier and signal. I guess a DSB or IQ passband technically contains the carrier too. It's just at DC (0 Hz).

    I found this which seems pretty clear on how to compute modulation index:
    https://www.tutorialspoint.com/analog_communication/analog_communication_amplitude_modulation.htm

    So by equation 3 you could filter and average the carrier and side-bands separately and then compare their amplitudes (Ac, Am). Or more simply by equation 8 average the entire signal (A) containing the carrier and side-bands and use the formula. You have to average for a little while because the transmitter is not sending you a nice test tone (say 1 kHz) for you to measure. You're measuring against random program material.
  • edited June 2020
    I think GRC can do this.... This paper shows some of the tools in GRC but not specifically a measurement method https://www.sciencedirect.com/science/article/pii/S187770581200985X/pdf?md5=863939e078075c78c67b1209201f11f5&pid=1-s2.0-S187770581200985X-main.pdf
  • Hi John, Thank you. The equation 3 is what we would like to extract out of the recorded IQ data made by the kiwirecorder. Yes, this has to be before the AM Demodulator. As you say the AM Demodulator filters out the Ac - the Carrier Amplitude and frequency.
    Yes, we do want to try check that AM Transmitters (Short-wave and MW) are not over modulating - over a 100% negative mod and causing splatter on the band and also check the AM Transmitter is modulating properly. Yes, we would have to somehow average this over a minute or so because of trying to do this with just average random programming that is on any AM Transmitter.
    You mention the IQ stream is explained in the wiki - could you please post the link?
    Many thanks..
  • Things get a bit more complicated with modern AM Transmitters as they use asymmetrical modulation. So one can get up to 125% positive modulation. This is done to increase the loudness of the audio. And modern AM Transmitters also use Dynamic Carrier Control. The Amplitude of the Carrier can go up and down with modulation. There are various types of DCC. This is done to save power. The BBC has experimented with this and written some papers on the subject.
  • A relevant reference is this one:
    https://itu.int/dms_pub/itu-r/opb/rep/R-REP-BS.2433-2018-PDF-E.pdf
    I am working on implementing the modulation depth RMS estimate from the IQ spectrum (after carrier subtraction with a PLL) in GNURadio.
  • edited June 2020
    @Christoph I'm looking at the code for the block and also at the ITU article linked from your blog, and the modulation index/depth seems to be computed as just the ratio of the square-rooted sideband and carrier powers. Normally, modulation index is described as the ratio of the voltages of the modulating wave and the carrier wave.

    Is this a valid method because of the fact that power is V^2/R? And assuming R doesn't change, then we can obtain the same ratio by square-rooting the powers? This would mean that the sideband power must correspond to the power of the modulating wave.

    I read through your post and the entire ITU article, and there are 2 things I don't quite understand.
    1. How is the ratio of the square-rooted powers of the sideband and carrier a valid way of getting the modulation index?
    2. What exactly is happening in the computation in the work function of the GNURadio block? What is contained in the input_items array?

    def work(self, input_items, output_items): #estimate RMS AM modulation depth from FFT spectrum z = input_items[0] # FFT coefficients for i in range(len(z)): az = np.abs(z[i,:]) ## absolute value for FFT coefficients pc = np.sqrt(az[0]**2 + 2*np.sum(az[1:4]**2)) # sqrt(carrier power) ps = np.sqrt(2*np.sum(az[4:1024//2]**2)) # sqrt(side-band power) output_items[0][i] = ps/pc # RMS modulation depth return len(output_items[0])

    If this is a valid method, then am I correct in assuming that if I wanted the peak modulation depth value I would simply multiply the rms modulation depth by sqrt(2)?
  • @jks Thank you. Ok so will have to use the IQ data to get the Carrier Amplitude along with trying to find a peak in the sidebands.
    Yes, to check if a AM transmitter is modulating well, Short-wave and MW, and not over modulating and causing splatter on band.
    In that good article, Equation 3 is a good starting point.
    Most AM Transmitters these days use asymmetrical modulation. Positive can go over 100% - up to 125% positive.
    So did want negative and positive modulation.
    On 19th June you mentioned the Wiki. Could you please post a link to this.
    Thanks.
  • @Jimo: I was just mentioning the generic Wikipedia entry for wav format files (https://en.wikipedia.org/wiki/WAV)
  • @djacobs
    I read through your post and the entire ITU article, and there are 2 things I don't quite understand.
    1. How is the ratio of the square-rooted powers of the sideband and carrier a valid way of getting the modulation index?
    2. What exactly is happening in the computation in the work function of the GNURadio block? What is contained in the input_items array?
    3. If this is a valid method, then am I correct in assuming that if I wanted the peak modulation depth value I would simply multiply the rms modulation depth by sqrt(2)?

    1. I followed the method in the ITU report. Note that for all measurements they use the RMS modulation depth.
    2. See the comments in the code and the flowgraph: the input consists of FFT coefficients where indices 0:1023 correspond to frequencies [0:1023]/1024*fs. Since there is a PLL removing the carrier frequency offset, the input to the FFT is essentially a real signal. Therefore I use only the first half of the FFT output because |z[i]| = |z[1024-i]| except for i=0.
    3. That is true if the modulated signal is a pure sine wave. For speech or music I am not sure this is true. Comparing RMS modulation depths for a good-sounding AM signal and one which has clipping you can figure out a threshold.
  • @jks Thank you. Ok so will have to use the IQ data to get the Carrier Amplitude.
    Yes, to check if a AM transmitter is modulating well, Short-wave and MW, and not over modulating and causing splatter on band.
    Most AM Transmitters these days use asymmetrical modulation. Positive can go over 100% - up to 125% positive.
  • edited September 2020
    If your goal is to check that the transmitter isn't splattering, why not just look directly at the modulated spectrum?

    Depending on the transmitter design, you could have more than 100% negative modulation and still not have splatter. One way is to tightly bandpass filter the modulated signal. Another is to use a balanced transmitter modulator that remains linear instead of clipping at 0, i.e., the signal phase inverts (flips 180 degrees). But in both cases an AM envelope detector would give a significantly distorted signal compared to the audio going into the modulator.

    Assuming neither is the case, then in principle it's pretty straightforward to estimate the average modulation by simply measuring the average sideband and carrier powers. On 100% sinusoidal modulation, the total power in the sidebands will be 50% of the power in the carrier, i.e., the total output power will be 150% of the carrier alone, without modulation. But things get tricky when the modulation is nonsinusoidal or unbalanced or there's selective fading. How could you tell the difference between an overmodulated sine wave and a 100% modulated square wave?

    But you're probably just interested in whether the instantaneous signal envelope ever goes to zero. One way to eyeball this is with the kiwisdr's IQ display feature with the PLL turned on. The carrier in an unmodulated, noise-free, non-fading AM signal will show up as a dot on the +I (right horizontal) axis. Modulation will spread this dot into a horizontal line that should never touch the Q (vertical) axis. If it does, the transmitter is being overmodulated.

    The IQ display can reveal other imperfections in the transmitter. AM-to-PM conversion will show up as a banana-shaped line that doesn't lie flat on the +I axis. WWV's 5, 10 and 15 MHz transmitters (especially 10 MHz) exhibit quite a bit of this.
  • edited March 2021
    @ka9q Thank you for this. I would like to measure the -ve and the +ve Modulation of a a AM signal using the kiwiclient. I can record the IQ wav file, but cannot find any info on how the IQ wav file is constructed in order to extract the information needed, like the Ac (Amplitude of the Carrier) and the Am (Amplitude of the Modulation).
    I see on my KiwiSDR I no longer get the Quad Plot when I switch to IQ. )-:
Sign In or Register to comment.