Questions tagged [spectrum]

The frequency domain of a wave-like function.

Spectrum refers to the full range of all frequencies of electromagnetic radiation. Spectrum has since been applied by analogy to topics outside of electromagnetic radiation. For a complete discussion, see the Wikipedia Spectrum article

389 questions
1
vote
1 answer

How to Extract the following Frequency-domain Features in Python?

Please feel free to point out any errors/improvements in the existing code So this is a very basic question and I only have a beginner level understanding of signal processing. I have a 1.02 second accelerometer data sampled at 32000 Hz. I am…
1
vote
0 answers

What do the bands in the AudioSpectrumListener represent?

This question is related to this other one. Like advised, I'm having a look at the AudioSpectrumListener, but my question is "what do those 128 bands represent?" A band is usually define by a frequency in Hz. So, shall I just estimate that the…
Dr_Click
  • 449
  • 4
  • 16
1
vote
2 answers

QVector always push back 0?

I am using FFTW to build a music visualizer. And in my header file, I construct a struct: struct SpectrumStruct{ qreal frequency; qreal amplitude; }; QVector m_spectrum; And in my .cpp file, void…
Liam_1998
  • 1,157
  • 3
  • 12
  • 27
1
vote
0 answers

Avoid loop in moving window in R

I have an example R script for spectrum calculation. I divide the signal into several blocks and do the calculation for each block. spect=function(x,samplingfrequency=1,blocksize=2^12) { T=length(x) blocks=trunc(T/blocksize) …
Haribo
  • 2,071
  • 17
  • 37
1
vote
0 answers

Note Generator Program in C

This is from a program I wrote while taking an electrical engineering course at uni. The ultimate goal was to make a spectrum analyzer. However, this was accomplished in small steps. First, we simply made a note generator and played the note through…
1
vote
1 answer

Scaling/Units of power spectrum (with R)

The spec.pgram() or the equivalent spectrum() functions in R scale the spectrum accroding to the documentation as follows: The spectrum here is defined with scaling 1/frequency(x), following S-PLUS. This makes the spectral density a density over…
NicolasBourbaki
  • 853
  • 1
  • 6
  • 19
1
vote
3 answers

How to calculate amplitude from spectrum()

I have a signal and I need to get the actual magnitude of a frequency found at spectrum() Consider the following signal f <- 5 n <- 500 signal <- 4*sin(2*pi*f*seq(0,10,1/n)) S.signal <- spectrum(signal, log="no") Using spectrum() I get the…
rvbarreto
  • 683
  • 9
  • 24
1
vote
1 answer

how to get the maximum amplitude value from the Python PSD function

I plotted this spectrum with the following code: PSD plot [Y,F]=psd(samples, NFFT=1024, Fs=sdr.sample_rate/1e6, Fc=sdr.center_freq/1e6, noverlap=0) xlabel('Frequency (MHz)') ylabel('Relative power (dB)') max=np.max(Y) print(max) but…
1
vote
0 answers

Lomb-Scargle periodograms to construct a spectrogram for nonuniformly sampled data?

I'd like to construct a 1D spatial spectrogram for nonuniformly sampled, nonstationary (xy-elevation) data with a wide range of sampling rates (~1-10000 pt/m). One way I think I could do this without running into problems due to the large number of…
Dandan
  • 143
  • 9
1
vote
1 answer

Matlab power spectrum density(PSD) implement equation

Folks, I am learning how to calculate PSD of a signal with matlab. I know function Periodogram() works good, but I want to use fft method directly. When I want to learn in detail, I find this website is very…
Sihao Sun
  • 13
  • 4
1
vote
1 answer

Audio spectrum analyzer (4410 values into 15 bars)

I want to make audio spectrum analyzer in Python. I used pyaudio library and I'm reading the stream from the microphone. For every read, I get 4410 values, that I convert to numbers using numpy and then draw them onto pygame screen. It looks like…
Adam Ježek
  • 464
  • 5
  • 15
1
vote
1 answer

How to control the FFTW frequency bins and resolution

I'm writing a code to compute a simple real data transformation using FFTW. I want to compare the spectrum of the FFTW to FT of the same data. My DFT data length is 5000. However, even if I use a much larger FFTW size (for example N=450000) I don't…
Tamim
  • 11
  • 2
1
vote
2 answers

FFT Spectrum not displaying correctly

I'm currently trying to display an audio spectrum using FFTW3 and SFML. I've followed the directions found here and looked at numerous references on FFT and spectrums and FFTW yet somehow my bars are almost all aligned to the left like below.…
trigger_death
  • 105
  • 1
  • 13
1
vote
1 answer

FFTW signal spectrum

I am currently working on implementing signal spectrum chart. My input data: 1.051, 1.365, 1.837, 2.334, 2.486, 2.688, 2.878, 2.579, 2.11, 1.605, 0.936, 0.73, 1.036, 1.336, 1.796, 2.043, 2.462, 2.935, 2.892, 2.609, 2.151, 1.641, 0.961, 0.738, 0.767,…
Taras Nikulin
  • 177
  • 11
1
vote
2 answers

Power spectrum incorrectly yielding negative values

I have a real signal in time given by: And I am simply trying to compute its power spectrum, which is the Fourier transform of the autocorrelation of the signal, and is also a purely real and positive quantity in this case. To do this, I simply…
Mathews24
  • 681
  • 10
  • 30