Problems regarding signal sampling

  • Thread starter Thread starter haha1234
  • Start date Start date
  • Tags Tags
    Sampling Signal
Click For Summary
SUMMARY

The discussion focuses on the behavior of sound signals generated in Matlab using the sine function and the impact of the continuous-time Fourier transform (CTFT) on pitch perception. The signals created have fundamental frequencies of 2000 Hz and 3000 Hz, and the pitch appears to increase with frequency when the CTFT is not applied. However, when the CTFT is applied using the function ctfts, the pitch remains constant despite the frequency increase. The analysis reveals that the distance between magnitude components increases with frequency, leading to the conclusion that the perceived pitch should decrease with higher frequencies, but this is not observed when using the CTFT.

PREREQUISITES
  • Understanding of Matlab programming and syntax
  • Knowledge of Fourier Transform concepts, specifically Continuous-Time Fourier Transform (CTFT)
  • Familiarity with signal processing principles, particularly sampling and pitch perception
  • Experience with complex numbers in signal processing
NEXT STEPS
  • Study the implementation and effects of the Continuous-Time Fourier Transform (CTFT) in signal processing
  • Learn about the differences between discrete and continuous signals in Matlab
  • Explore the impact of sampling rates on pitch perception in audio signals
  • Investigate the use of the abs() function in Matlab for handling complex arrays in sound generation
USEFUL FOR

Audio engineers, signal processing students, Matlab users, and anyone interested in understanding the relationship between frequency, sampling, and pitch perception in sound signals.

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 ·
Replies
6
Views
5K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 34 ·
2
Replies
34
Views
12K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K