How to sample a signal using Golomb Ruler ?

I'm trying to sample a multi-sine signal by Golomb Ruler of length 151, how can I achieve this ?
Below is the signal plot for sine wave sampled Golomb Ruler of length 151.
Amplitude spectrum of the above samples (visible peak at the expected frequency 24Hz above the “under-sampling” noise)
clear all
close all
clc
%%
Fs = 1000; % Sampling Freq.
T = 1/Fs; % Sampling period
L = 1024; % Length of signal
t = 2*(0:L-1)*T; % Time vector
x = 0; % Signal intial value
y = 0; % Signal intial value
F = 24; % Signal Freq.
seq = [0 4 20 30 57 59 62 76 100 111 123 136 144 145 151]; %Golomb Seq. ??
% x = cos(2*pi*F*seq);
for i01=1:length(seq)
for u = 0:seq(i01)
x = x + cos(2*pi*F*u+pi/2);
end
end
figure
subplot(2,2,1)
plot(seq,x)
title('Original signal')

 Accepted Answer

The only idea that makes sense to me with sampling like this using a Golomb-ruler is that you're expected to get estimates of the the power-spectrum of the orignal signal by calculating all the combinations of complex-conjugated product of the samples. That is from the first and the second sample (corresponding to time-steps of 0 and 4) you would get an estimate of the autocorrelation-function, ACF, at a lag of 4, from the first and third sample (correpsponding to time-steps 0 and 20) you would get an estimate of the ACF at a lag of 20, from the second and third sample (correpsponding to samples at time-steps 4 and 20) you would get an ACF-estimate at a lag of 16 etc. The Golomb-rulers have a couple of nice-enough features for this type of operations. With this advice you should be able to get the ACF at all lags between zero and 151 except 46. If you know that your signal is real-valued you also know that the real part of the ACF is even and the imaginary part is odd. That should then set you up for Fourier-transforming the ACF to get the power-spectrum
HTH

5 Comments

I understood the concept of golomb ruler but I couldn't apply it in MATLAB.
Does the golomb ruler have a function in MATLAB ?
Thank you,
The way I understand the task you should take samples at times corresponding to the positions of the Golomb-ruler of length 151. You can find its construction on the wikipedia-page for Golomb-rulers. Presumably you have a signal as a function of time. Simply create a time-vector corresponding to your sampling-frequency, use the array with the indices of the 151-long GR, seq (but you have to add 1 to that since matlab is an index-1 based language). Calculate the signal for your time-array. Extract the samples of the times with indices of the GR. Proceed from there to calculate the complex-conjugated products of the different sample-combinations and assign them to an elements of an array that corresponds to the time-difference between the samples.
HTH
Can I also use the set of optimal Golomb seq. values available on Wikipedia-page for length 151 ?
  • And how can I Extract the samples of the times with indices of the GR in matlab ?
clear all
close all
clc
%%
Fs = 1000; % Sampling Freq.
T = 1/Fs; % Sampling period
L = 1024; % Length of signal
% StopTime = 0.25; % seconds
t = 2*(0:L-1)*T; % Time vector
x = 0; % Signal intial value
F = 24; % Signal Freq.
seq = [1 4 20 30 57 59 62 76 100 111 123 136 144 149 151];
x = cos(2*pi*F*t);
y = x(seq(:));
figure
subplot(2,2,1)
plot(t,x)
title('Original signal')
subplot(2,2,2)
stem(seq,y)
title('GR samples')
Regarding the amplitude spectrum, how can I write a code that will display a similar waveform to the one shown above ?
First off, you'll have to fix the seq-variable in your script above:
seq = [1 4 20 30 57 59 62 76 100 111 123 136 144 149 151];
Is not a GR, since a GR should by definition have unique non-repeatable differences between the elements. In your seq we have a difference between 4 and 1 of 3 units, and another difference between 62 and 59. You have to add 1 to every element, not just change the first zero to one. Like this:
seq = [0 4 20 30 57 59 62 76 100 111 123 136 144 149 151]+1;
What you should do next is to calculate the product of each unique pair of samples from the GR-samples. That will give you the estimates of the ACF for the time-lag corresponding to the time-difference between the samples. If you do a double-loop over the samples-sequence what would you get from each step and where would you store those to get these organized correctly?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!