search
HomeComputer TutorialsComputer KnowledgeHow to extract speech database using MATLAB

How to extract speech database using MATLAB

How to extract speech database using matlab

1. Use the audioread(''); function to read the audio file in the computer. The parameter is the path of the audio file:

[sampledata,FS] = audioread('F:1.mp3');

sampledata saves audio signal data, FS is the audio sampling rate, and the sampling rate of MP3 format is generally 44100;

Determine whether the audio data is binaural. If it is binaural, retain the data of one channel. You can use the function of the calsample.m file to achieve this. The content of the file is as follows:

function sample = calsample(sampledata,FS)

temp_sample = resample(sampledata,1,FS/11025);

[m,n] = size(temp_sample);

if (n == 2)

sample = temp_sample(:,1);

else

sample = temp_sample;

end

end

Matlab database programming

A. Use a simple UPDATE

The following example shows how all rows will be affected if the WHERE clause is removed from the UPDATE statement.

The following example illustrates how the publishers table is updated if all publishers in the publishers table move their headquarters to Atlanta, Georgia.

UPDATE publishers

SET city = 'Atlanta', state = 'GA'

This example changes all publisher names to NULL.

UPDATE publishers

SET pub_name = NULL

Calculated values ​​can also be used in updates. This example doubles all prices in the titles table.

UPDATE titles

SET price = price * 2

B. Use the WHERE clause with the UPDATE statement

The WHERE clause specifies the rows to be updated. For example, in the following fictional event, Northern California was renamed Pacifica (abbreviated as PC), and the citizens of Oakland voted to change the name of their city to Bay City. This example shows how to update the authors table for all previous residents of Oakland City whose addresses are out of date.

UPDATE authors

SET state = 'PC', city = 'Bay City'

WHERE state = 'CA' AND city = 'Oakland'

Another statement must be written to change the state name for residents of other Northern California cities.

C. Use information from another table through the UPDATE statement

This example modifies the ytd_sales column in the titles table to reflect the latest sales records in the sales table.

UPDATE titles

SET ytd_sales = titles.ytd_sales sales.qty

FROM titles, sales

WHERE titles.title_id = sales.title_id

AND sales.ord_date = (SELECT MAX(sales.ord_date) FROM sales)

This example assumes that a specific product records only one batch of sales on a specific date, and the update is the latest. If this were not the case (i.e. if more than one batch of sales could be recorded for a particular item on the same day), the example shown here would be wrong. The example works correctly, but each item is updated with only one batch of sales, regardless of how many batches were actually sold that day. This is because an UPDATE statement never updates the same row twice.

For situations where more than one batch of a specific item can be sold on the same day, all sales for each item must be totaled together in the UPDATE statement, as shown in the following example:

UPDATE titles

SET ytd_sales =

(SELECT SUM(qty)

FROM sales

WHERE sales.title_id = titles.title_id

AND sales.ord_date IN (SELECT MAX(ord_date) FROM sales))

FROM titles, sales

D. Using the UPDATE statement with the TOP clause in a SELECT statement

This example updates the state column of the first ten authors from the authors table.

UPDATE authors

SET state = 'ZZ'

FROM (SELECT TOP 10 * FROM authors ORDER BY au_lname) AS t1

WHERE authors.au_id = t1.au_id

How to import data sets into the database using matlab

You can use the xlswrite function directly in the m file: (filename/sheet/range must be added in single quotes)

xlswrite(filename, M); Write the data of matrix M into the Excel file named filename.

xlswrite(filename, M, sheet); Write the data of matrix M to the specified sheet in filename.

xlswrite(filename, M, range); Write the data in matrix M to the Excel file named filename, and the storage area is specified by range, such as 'C1:C2'.

xlswrite(filename, M, sheet, range); Specifies the sheet to be stored based on the previous command.

status = xlswrite(filename, ...); Return the completion status value. If the writing is successful, the status is 1; otherwise, the writing fails, the status is 0.

[status, message] = xlswrite(filename, ...);Return any error or warning information generated due to the write operation

Application examples

Example 1: Write data to the default worksheet

Write a seven-element vector into testdata.xls. In the default format, data will be written to cells A1 to G1 of the first worksheet in the file. xlswrite('testdata.xls', [12.7 5.02 -98 63.9 0 -.2 56])

Example 2: Write mixed data into the specified worksheet

d = {'Time', 'Temp'; 12 98; 13 99; 14 97};

s = xlswrite('tempdata.xls', d, 'Temperatures', 'E1')

The above is the detailed content of How to extract speech database using MATLAB. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:Excel办公网. If there is any infringement, please contact admin@php.cn delete
How to Find and Back up Resident Evil 4 Saves? Here Is a Guide! - MiniToolHow to Find and Back up Resident Evil 4 Saves? Here Is a Guide! - MiniToolApr 14, 2025 am 12:50 AM

Do you wonder how to find Resident Evil 4 saves? How to back up Resident Evil 4 saves? This post from php.cn provides 3 ways for you to back up Resident Evil 4 saves. Now, keep on your reading.

How to Limit the Number of Login Attempts on WindowsHow to Limit the Number of Login Attempts on WindowsApr 14, 2025 am 12:49 AM

If someone tries to access your computer by inputting numerous key combinations, your computer is at a higher risk of being opened. Therefore, it is quite needed to limit the number of login attempts. How to do it? Read this php.cn post.

Cfgmgr32.dll Not Found? Fix the Issue Easily via Simple MethodsCfgmgr32.dll Not Found? Fix the Issue Easily via Simple MethodsApr 14, 2025 am 12:48 AM

Cfgmgr32.dll missing errors often happen to annoy people a lot and leave some more severe issues in your Windows. So, what should you do when you run into the Cfgmgr32.dll not found issue? This post on php.cn Website will tell you some methods.

Fixed: Lock Screen Timeout Is Not WorkingFixed: Lock Screen Timeout Is Not WorkingApr 14, 2025 am 12:47 AM

Have you ever encountered a problem where the Windows lock screen timeout is not working? Fortunately, several feasible solutions are available in this post from php.cn. Applying these fixes, you can address this annoying issue effectively.

Windows 11 23H2 Is Released! How to Get It on Your PC?Windows 11 23H2 Is Released! How to Get It on Your PC?Apr 14, 2025 am 12:46 AM

Microsoft has released Windows 11 23H2 (the Windows 11 2023 Update) for a while. Do you want to install this update on your device? What are the new features in it? How to get this update immediately? Now, you can get the information from this php.cn

How to Bypass Windows Defender Windows 10/11? - MiniToolHow to Bypass Windows Defender Windows 10/11? - MiniToolApr 14, 2025 am 12:45 AM

Windows Defender can protect your computer and the files on the device from attacks or infection of malware and viruses. However, sometimes, you need to bypass Windows Defender due to some reason. In this post on php.cn Website, we will introduce 3 w

6 Best Ways for Data Supplied Is of Wrong Type on PC6 Best Ways for Data Supplied Is of Wrong Type on PCApr 14, 2025 am 12:44 AM

When trying to copying or transferring files from mobile phones to your computer, you might get the Data supplied is of wrong type error message. If you have no idea about how to address it, this post on php.cn Website can help you out.

Discover How to Reset Excel to Default Settings EffortlesslyDiscover How to Reset Excel to Default Settings EffortlesslyApr 14, 2025 am 12:43 AM

Want to revert changes you have made to Microsoft Excel? Here this article on php.cn Software aims to show you how to reset Excel to default settings in Windows 10 with the most effective ways.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools