From: Abdullah on
Hi everyone,

The frequency of our device is 2.25 MHz while in the following program is 100 Hz. The question is how to change the parameters in the following program to have about 2.25 MHz:

Please Help me if you can?
Thanks

clear all;
close all;
clc

T = 0:0.001:2;
F=0:.1:100; % frequency constant

[Y,F,T,P]= spectrogram(X,256,250,F,1E3,'yaxis');
spectrogram(X,256,250,F,1E4,'yaxis');

image(T,F,10*log10(abs(Y)));
axis xy;
xlabel('Time')
ylabel('Frequency')

Thanks again
Abdullah
From: Greg Heath on
On Aug 9, 1:15 am, "Abdullah " <zabdull...(a)hotmail.com> wrote:
> Hi everyone,
>
> The frequency of our device is 2.25 MHz while in the following program is 100 Hz. The question is how to change the parameters in the following program to have about 2.25 MHz:
>
> Please Help me if you can?
> Thanks
>
> clear all;
> close all;
> clc
>
> T = 0:0.001:2;
> F=0:.1:100; % frequency constant
I guess you mean frequency "samples".

In general,

Fs sampling rate
N number of samples
dt = 1/Fs time sampling interval
T = N*dt ifft period

t = 0:dt:T-dt; % time samples
t = dt*(0:N-1);

df = Fs/N (=1/T) % frequency sampling interval
f = 0:df:Fs-df; % frequency samples
f = df*(0:N-1);

Consider observing frequency f0 = 2.25e3 with
period T0 = 1/f0 = 0.4444e-3

1. The sampling rate should obey the Nyquist criterion
Fs-df >= 2*f0 = 4.5e3
2. The observation window should allow a complete period
T-dt >= T0 = 0.6667e-3

Practical choices

Fs >= 4*f0 = 9e3
T >= 2.5*T0 = 1.111e-3
N = Fs*T > 10

Hope this helps.

Greg