Monthly Archives: March 2009

Even bigger primes…

Last year, I wrote a post about a program I wrote to compute a really large prime number. . At the time, 232482657-1 was “king” of the primes, having over 9.8 million digits. Today, one year later, it turns out that the Great Internet Mersenne Prime Search has discovered two even larger primes. I dusted off my code, and was pleased to find that it still worked, generating the nearly 13 million digits of the new king of primes in roughly two minutes…

Here are the digits of 243112609-1:

    316,470,269,330,255,923,143,453,723,
949,337,516,054,106,188,475,264,644,140,
304,176,732,811,247,493,069,368,692,043,
185,121,611,837,856,726,816,539,985,465,
097,356,123,432,645,179,673,853,590,577,
432597 lines deleted...
915,084,069,991,159,279,791,908,398,130,
223,304,824,083,119,093,195,998,014,562,
456,347,941,202,195,900,928,079,670,729,
447,921,616,491,887,478,265,780,022,181,
166,697,152,511

Addendum: Okay, it dawns on me that I never explained why this is difficult. Here’s the thing: Mersenne primes are really easy to write in binary: they are just a long string on ones. But to write them out in base 10 like we all know and love is more difficult. To do it, I actually do all my arithmetic in base 1000 (a convenient choice, because we want to print out the number with commas in place). Computing the prime isn’t very hard really, ab is 1 if b equals 0, is a * ab-1 if b is odd, and is ab/2 squared if b is even. Then, you only need to do log2(b) multiplies to get your (in this case very big) number. The real trick comes in doing the multiply: the obvious algorithm takes O(n2) time to multiply two numbers. But a faster way is to use the FFT. The trick is realizing that multiplying numbers using the old scheme is basically a lot like convolution. Convolution can be changed to simple multiplication by using the Fast Fourier Transform. So, here’s the basic idea. Suppose you have a number represented in base 1000. Pad it with an equal number of zeros. Then take the Fast Fourier Transform. Square each resulting bin. Then inverse FFT it. You’ll be left with some bins with values > 1000. But you can normalize those by dealing with the carries. And you are done! The FFT only takes O(nlogn) time, the normalization is linear, so you are much, much faster in the limit doing multiplies this way.

There are a few issues with precision but overall, it works quite well.

Grabber down for a couple of days

Sadly, last night I was working late, and was tired, and managed to delete a chunk of my grabber recording source code. The bad news is that I didn’t have it backed up, so I have to rewrite it. The good news is that hey, I get to rewrite it!

Seriously, it’s only a few hndred lines of code, and I pretty much remember exactly how it works, but it was reasonably subtle, and might take a bit of tinkering to restore. I’ll try to get it going Saturday.

WSPR DX from the land of penguins…

Well, after failing on 20m earlier in the day, I waited a bit, until I saw that Felix, DP1POL had shifted from 20m to 40m. I then flipped my beacon/grabber over to 40m, and gave it a try at the 5w power level. And…

Timestamp Call MHz SNR Drift Grid Pwr Reporter RGrid km az
 2009-03-13 02:10   K6HX   7.040031   -18   0   CM87ux   5   DP1POL   IB59uh   14831   155 
 2009-03-13 02:02   K6HX   7.040031   -16   -1   CM87ux   5   DP1POL   IB59uh   14831   155 
 2009-03-13 01:54   K6HX   7.040030   -16   0   CM87ux   5   DP1POL   IB59uh   14831   155 
 2009-03-13 01:46   K6HX   7.040030   -19   0   CM87ux   5   DP1POL   IB59uh   14831   155 

If you look carefully, you’ll see an unusual grid square. DP1POL is operating from the German Neumayer III Station on the Ekstroem Shelf Ice, Atka Bay, in Antartica. Felix will be working their for quite some time, so I will undoutably have multiple opportunities to get him on multiple bands.

Another reason that this contact is significant is that it’s actually my furthest DX, further even than VK6DI. I decided to remake my WSPR spot map:

world

WSPR on 20m, trying to snag DP1POL…

I don’t think this is going to work, but I noticed that DP1POL is currently reporting WSPR spots and being spotted from his base in IB59uh. That’s Antartica. I couldn’t resist the temptation to try, so I’ve shifted my WSPR beacon over to 20m and upped the power to 5 watts to see if I can get him. Currently, he seems to be getting mostly Europe, but I thought I’d give it a try. My grabber is down for a little while while I make this (probably futile) attempt.

Update: I’ve resumed normal 30m grabber/beacon ops, again using step morse.

K6HX transmitting “Step Morse” now….

I’ve changed my beacon to send “step morse” for a while. It will look like this (thanks to WA0UWH’s grabber):

picture-13

It’s kind of wacky, but here’s the deal: there is a center line frequency which represents the space between characters. The message starts out at the centerline. Anything below the centerline represents a dit, above, a dah. If you send two dots or dashes in a row, it alternates between the two frequencies above or below, respectively. It dawns on me that when I change from dot to dash, it would be better to shift to the highest or lowest frequency, to enhance legibility. Hmm. I’ll tweak that later. But for now, if you see this, it’s me. Just changed it. The overall signal will be slightly wider now.

Addendum: Oops. Math error. The overall signal was twice as wide as I intended. Here’s what it’s currently sending, which should be the final version.

picture-15

SDR Software for the Mac

Part of the difficulty that I had testing my Softrok was the apparent lack of SDR software for my MacBook. Both WY7USA and NM5DV came through for me though, and suggested that I have a peek at DSPRadio, by Sebastian Mrozek, DO8SEM. It didn’t fix the imbalance/lack of sensitivity that I had, but it did allow me to test it in a more interactive fashion. Here I am, centered over the K beacon (the frequencies aren’t calibrated, but might be close).

picture

First signals heard through the Softrock Lite II

Well, I’m not sure that the Softrock I put together is working entirely well. I’m beginning to believe that the transformer that I wound might be bad. My receiver seems a bit deaf, and also seems to have only about 20db or so of opposite side rejection (I’m getting images of signals on both sides of the center carrier frequency). I’m a bit stymied by the fact that I only have my macbook in a place where it can be used to decode the softrock, and the software for it is, well, to a first approximation, there isn’t any. I did a bit of hacking, and took a recording I made and extracted this Morse code recording, which I’ll archive here as the first that I ever got.

Morse via my Softrock

I’ll have to work on it some more in the future, but for now, I’m back to beaconing with my FT-817.

Softrock Lite II breaths it’s first breath…

Well, since I have Tom’s oscilloscope, I started probing around, measuring the voltages and waveforms of pretty much every location I could find. And, low and behold, I didn’t really find anything wrong. I began to question my earlier assessment that anything was wrong at all. So, I hooked the gadget up again, wired on the antenna, and recorded a minute of audio at 96khz, 24 bit on my Macbook using Audacity. I then took my spectrum analysis code that I wrote, hacked out some bits, made it read I/Q signals, and fed in the audio. Here’s what I got:

test

Two strong morse signals, and part of a third!

A couple of things leap to mind here: it’s pretty clear that the sound card on my laptop can’t actually do 96Khz sampling. Audacity offers this as an option, but I suspect that somewhere along the audio chain, something is interpolating to give us 96Khz signal wihtout any actual data. The other thing is that we see a symmetry: identical signals above or below the center line. I suspect this means that I’m only getting one of the I/Q channels, not both. Were they properly phased, one of those would cancel out, and we’d just get the version of it above or below. So, I’m not out of the woods, but I am at least on the right track. I suspect some painstaking checking of solder joints might yield results.

It’s clear I also need to get some real interactive software running. Oh well, I feel like relaxing today a bit away from the radio, but maybe I’ll get back to it tomorrow. Once I get this 40m one debugged, I’ll try to take what I’ve learned and get going on my 30m one.

Addendum: I uncovered a couple of bugs while mucking around a little bit more, and now have the following image:

fixed2

I checked the RMS amplitude of the I and Q signals separately, and it appeared that the Q is significantly lower in amplitude. I tried a quick patch to normalize it to the other amplitude, but it appears to not be cancelling out the opposite sideband much better. I’ll have to think about this some more.

Addendum: The basic software appears to work. I tried using it on a recording I fetched from the web, and it worked perfectly for that. Must be something wrong with my softrock still. I suspect something in the op amp circuit. I’ll check it all out tomorrow.

Gutenberg Gem: Advice to Young Musicians. Musikalische Haus- und Lebens-Regeln, by Robert Schumann

Project Gutenberg just released the following:

The Project Gutenberg eBook of Advice to Young Musicians. Musikalische Haus- und Lebens-Regeln, by Robert Schumann
It’s nominally a book of proverbs about learning how to become a musician, but music is like many other fields in which you might gain expertise, so the advice in general is quite appropriate to other disciplines. Some nice quotes.

When you play, never mind who listens to you.

When you have done your musical day’s work and feel tired, do not exert yourself further. It is better to rest than to work without pleasure and vigour.

As to choice in the study of your pieces, ask the advice of more experienced persons than yourself; by so doing, you will save much time.

Relieve the severity of your musical studies by reading poetry. Take many a walk in the fields and woods!

Highly esteem the Old, but take also a warm interest in the New. Be not prejudiced against names unknown to you.

In judging of compositions, discriminate between works of real art and those merely calculated to amuse amateurs. Cherish those of the former description, and do not get angry with the others.

Without enthusiasm nothing great can be effected in art.

and perhaps most importantly…

There is no end of learning.

One might just as well think he was talking about any of my other interests, like telescope making, mathematics, or amateur radio.

Nice morning QRSS gallery…

This morning, I have a particularly nice array of signals streaming across. First NM5DV at the top. He put a T-attenuator onto his Softrock transmitter, knocking his 1watt down to around 400mw. WA5DJJ is banging in again as usual (he’s on virtually the entire day). You can begin to see WB3ANQ’s snake, running in at 1.5watts at the moment, and then down at the bottom, W1BW’s flying W and of course my regular as rain Australian DX, VK6DI.

morning

Addendum: WA0UWH has a similarly nice display this morning, including my own signal front and center:

capt1