Problems regarding signal sampling

  • Thread starter Thread starter haha1234
  • Start date Start date
  • Tags Tags
    Sampling Signal
AI Thread Summary
The discussion revolves around the behavior of signal pitches generated in MATLAB using different frequencies. It highlights that the pitch appears to increase with higher frequencies (w0) when not using the continuous-time Fourier transform (CTFS) function, while applying CTFS results in consistent pitch. The Fourier series derivations indicate that the distance between magnitude components increases with frequency, suggesting a decrease in perceived pitch. However, the CTFS function alters the signal representation, leading to similar pitch perceptions despite frequency changes. The conversation emphasizes the importance of understanding the Fourier Transform's impact on frequency representation and auditory perception.
haha1234
Messages
109
Reaction score
0

Homework Statement


I have created four signals in Matlab and we need to play the sound of these signals.
The four signals I've created are:

n=[0:8191];
w0=2*pi*2000;
T=1/8192;
t=[0,1];
t=n*T;
x=sin(w0*t);
sound(x,1/T);
-----------------

n=[0:8192];
w0=2*pi*2000;
T=1/8192;
t=[0,1];
t=n*T;
x=sin(w0*t);
[X,f]=ctfs(x,T);
sound(X,1/T);
-------------------------
n=[0:8191];
w0=2*pi*3000;
T=1/8192;
t=[0,1];
t=n*T;
x=sin(w0*t);
sound(x,1/T);
--------------------
n=[0:8192];
w0=2*pi*3000;
T=1/8192;
t=[0,1];
t=n*T;
x=sin(w0*t);
stem(x(1:50));
---------------------
The function ctfs is defined as:

function [X,f] = ctfts(x,T)
% CTFTS calculates the continuous
-
time Fourier transform (CTFT) of a
% periodic signal x(t) which is reconstructed from the samples in the
% vector x using ideal band
limited interpolation. The vector x
% contains samples of x(t) over an integer number of periods, and T
% contains the sampling period.
%
% The vector X contains the area of the impulses at the frequency
% values stored in the vector f.
%
% This function m
akes use of the relationship between the CTFT
% of x(t) and the DTFT of its samples x[n], as well as the
% relationship between the DTFT of the samples x[n] and the DTFS of x[n].
N = length(x);
X = fftshift(fft(x,N))*(2*pi/N);
f = linspace(-1,1-2/N,N)/(2*T);


The w0 of the first two signals is 2*pi*2000 and the w0 of the last two signals is 2*pi*2000.
Why the pitch of the signals increase as the w0 increase when we do not apply the ctfs function, while the pitches are the same when we apply the function?

Homework Equations


3. The Attempt at a Solution [/B]
I tried to find out the reason why by deriving the Fourier series of the sampled signals.
And the results are shown below:

For w0=2*π*2000:
The Fourier series is:
x[n]=sin(2π*2000*n/8192)
=sin(125πn/256)
=1/2ej125πn/256-1/2e-j125πn/256

For w0=2*π*3000:
The Fourier series is:
x[n]=sin(2π*3000*n/8192)
=sin(375πn/512)
=1/2ej375πn/512-1/2e-j375πn/512

From these results, I found the magnitude spectra and I discovered that the distance between each magnitude components(?) getting longer as the w0 increase. Therefore, I think the pitch should be decrease with the increase of w0.

On the other hand, I have no idea why the pitch does not change when we add the function ctfs?

Thanks!
 
Physics news on Phys.org
haha1234 said:
The w0 of the first two signals is 2*pi*2000 and the w0 of the last two signals is 2*pi*2000.
You meant 2*pi*3000 for the last two.
Also:
* your function name is ctfts, but you call it ctfs
* sound requires a real array, you are providing a complex array - use abs().
* The code you provided for creating the 3000 Fourier sound doesn't do that.
haha1234 said:
Why the pitch of the signals increase as the w0 increase when we do not apply the ctfs function, while the pitches are the same when we apply the function?

From these results, I found the magnitude spectra and I discovered that the distance between each magnitude components(?) getting longer as the w0 increase. Therefore, I think the pitch should be decrease with the increase of w0.

On the other hand, I have no idea why the pitch does not change when we add the function ctfs?

Thanks!
Any variation of the Fourier Transform should put you in the frequency domain. I haven't looked at your ctfs function in detail, but I accept that it qualifies as a "variation of the Fourier Transform".
When taking the FT of a signal, a change in frequency (from 2000 to 3000) should result in a shift in the FT. So, for example, in the 2*pi*2000 case, you would get a peak at 2000 and perhaps some harmonics. And with 2*pi*3000, you would get a peak at 3000 and some harmonics. If those harmonics were strong, you might notice a pitch change, but with sine waves, they are probably inaudible. So would you should get is a click - the same click in both cases, just slightly more delayed for the 3000Hz case.
 
So with 2*pi*2000, you get clicks at 4096 +/- 2000. With 2*pi*3000, you get clicks at 4096 +/- 3000.
In both cases you get 2 clicks, but the clicks are spaced further apart with 3000.
 

Similar threads

Replies
6
Views
5K
Replies
1
Views
2K
Replies
14
Views
3K
Replies
34
Views
12K
Replies
5
Views
2K
Back
Top