Hello and happy winter holidays!
I have recorded a signal (let's name it "Amplitude") for a very long time (i.e. hours) and I am trying to see if I can detect certain behaviours/events (i.e. which I suspect can be detected, but I am not sure about it).
I plan to visually detect the sought after events by looking at the plot of signal spectrogram against time. I would like to use the signal.spectrogram function of scipy library in Python to compute the spectrogram of my recorded signal.
I would say the events I am trying to find take place in a time window of less than 3 second and at a very low frequency (i.e. less than 10Hz). Therefore, I am computing the spectrogram for 6 seconds windows with an overlap of 3 seconds between adjacent windows.
However, given that my sampling rate is 100 Hz, the spectrogram frequency range goes up to half of it, 50 Hz.
I would like to know if there is any way I can compute the spectrogram only up to 10 Hz or if the only solution is to slice the full spectrogram (i.e. computed up to 50 Hz) afterwards.
Following is the code I use to compute the signal spectrogram up to 50Hz:
from scipy import signal
#Read the Amplitude vector
# Amplitude = ...
# Define sampling rate
Sampling_rate = 100 #Hz
# Define the time length of the segments into which the Amplitude vector is divided (in seconds)
Segment_time_length = 6 #s
# Define the element length of the segments into which the Amplitude vector is divided
Segment_element_length = int(Segment_time_length*Sampling_rate)
# Define the overlapping ratio between adjacent segments
Overl_ratio = 0.5
# Compute the overlapping element length between adjacent segments
Overl_element_length = int(Overl_ratio*Segment_element_length)
# Compute the spectrogram
Spectrogram_frequency_range, Spectrogram_time_vector, Spectrogram_amplitude = signal.spectrogram(Amplitude, fs = Sampling_rate, window = 'hann', nperseg = Segment_element_length, noverlap = Overl_element_length, mode = 'magnitude', nfft = 1024)
The code I wrote returns a spectrogram whose frequency range goes up to 50Hz. Is there any way to make the signal.spectrogram function run up to 10Hz only?
@Nick - I am interested in the frequencies from 0 to 10 Hz
Thank you and enjoy your winter vacation!