Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 985091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:06:58+00:00 2026-05-16T05:06:58+00:00

Yesterday I finalised the code for detecting the audio energy of a track displayed

  • 0

Yesterday I finalised the code for detecting the audio energy of a track displayed over time, which I will eventually use as part of my audio thumbnailing project.

However I would also like a method that can detect the pitch of a track displayed over time, so I have 2 options from which to base my research upon.

[y, fs, nb] = wavread('Three.wav');                  %# Load the signal into variable y

frameWidth = 441;                                    %# 10 msec
numSamples = length(y);                              %# Number of samples in y
numFrames = floor(numSamples/frameWidth);            %# Number of full frames in y
energy = zeros(1,numFrames);                         %# Initialize energy

for frame = 1:numFrames                              %# Loop over frames
  startSample = (frame-1)*frameWidth+1;              %# Starting index of frame
  endSample = startSample+frameWidth-1;              %# Ending index of frame
  energy(frame) = sum(y(startSample:endSample).^2);  %# Calculate frame energy
end

That is the correct code for the energy method, and after researching, I found that I would need to use a Discrete Time Fourier Transform to find the current pitch of each frame in the loop.

I thought that the process would be as easy as modifying the final lines of the code to include the “fft” MATLAB command for calculating Discrete Fourier Transforms but all I am getting back is errors about an unbalanced equation.

Help would be much appreciated, even if it’s just a general pointer in the right direction. Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T05:06:58+00:00Added an answer on May 16, 2026 at 5:06 am

    Determining pitch is a lot more complicated than just applying a DFT. It also depends on the nature of the source – different algorithms are appropriate for speech versus a musical instrument, for example. If this is a music track, as your question seems to imply, then you’re probably out of luck as there is no obvious way of determining a single pitch value for multiple musical instruments playing together (how would you even define pitch in this context ?). Maybe you could be more specific about what you are trying to do – perhaps a power spectrum would be more useful than trying to determine an arbitrary pitch ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Yesterday i tried to use std::unordered_map and this code confused me how much memory
Yesterday I ran into a situation (which I resolved by studying my code a
Yesterday, after about two years we re-deployed our application. Code hasn't changed, but the
Yesterday I was thinking about whether it would be possible to use the convenience
Yesterday I have been testing one single query for over hours and hours, but
Yesterday I discovered an odd bug in rather simple code that basically gets text
Yesterday, I found myself writing code like this: SomeStruct getSomeStruct() { SomeStruct input; cin
Yesterday I read some code of a colleague and came across this: class a_class
Yesterday my HDD decided to die on me, which caused me to lose a
Yesterday i asked this question: Get current time and set a value in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.