How to set frequency axis to a specific range in a spectogram?

39 ビュー (過去 30 日間)
Laura Velasquez
Laura Velasquez 2021 年 1 月 28 日
回答済み: Laura Velasquez 2021 年 2 月 5 日
Hi, I am making my first spectogram in Matlab using the spectogram function. I made the spectogram but the x axis is from 0 to 22.000 Hz. However, I want to focus on low frequencies from 0 to 2000. How can I change it?
This is the code I am using:
[x, fs] = audioread('ramp_up.wav')
x = x(:, 1);
N = length(x);
t = (0:N-1)/fs;
N/fs
spectrogram(x, 1024, 512, 1024, fs, 'yaxis')

採用された回答

Laura Velasquez
Laura Velasquez 2021 年 2 月 5 日
I am just learning how to use matlab, so I was looking for a simpler answer.
I set-up my axis limits just using this bit of code:
ylim([0 2])
It worked

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Coder についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by