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 Solve Windows Error Code "INVALID_DATA_ACCESS_TRAP" (0x00000004)How to Solve Windows Error Code "INVALID_DATA_ACCESS_TRAP" (0x00000004)Mar 11, 2025 am 11:26 AM

This article addresses the Windows "INVALID_DATA_ACCESS_TRAP" (0x00000004) error, a critical BSOD. It explores common causes like faulty drivers, hardware malfunctions (RAM, hard drive), software conflicts, overclocking, and malware. Trou

ENE SYS Maintenance: Tips and Tricks to Keep Your System Running SmoothlyENE SYS Maintenance: Tips and Tricks to Keep Your System Running SmoothlyMar 07, 2025 pm 03:09 PM

This article provides practical tips for maintaining ENE SYS systems. It addresses common issues like overheating and data corruption, offering preventative measures such as regular cleaning, backups, and software updates. A tailored maintenance s

5 Common Mistakes to Avoid During ENE SYS Implementation5 Common Mistakes to Avoid During ENE SYS ImplementationMar 07, 2025 pm 03:11 PM

This article identifies five common pitfalls in ENE SYS implementation: insufficient planning, inadequate user training, improper data migration, neglecting security, and insufficient testing. These errors can lead to project delays, system failures

How do I edit the Registry? (Warning: Use with caution!)How do I edit the Registry? (Warning: Use with caution!)Mar 21, 2025 pm 07:46 PM

Article discusses editing Windows Registry, precautions, backup methods, and potential issues from incorrect edits. Main issue: risks of system instability and data loss from improper changes.

Discover How to Fix Drive Health Warning in Windows SettingsDiscover How to Fix Drive Health Warning in Windows SettingsMar 19, 2025 am 11:10 AM

What does the drive health warning in Windows Settings mean and what should you do when you receive the disk warning? Read this php.cn tutorial to get step-by-step instructions to cope with this situation.

How do I manage services in Windows?How do I manage services in Windows?Mar 21, 2025 pm 07:52 PM

Article discusses managing Windows services for system health, including starting, stopping, restarting services, and best practices for stability.

which application uses ene.syswhich application uses ene.sysMar 12, 2025 pm 01:25 PM

This article identifies ene.sys as a Realtek High Definition Audio driver component. It details its function in managing audio hardware, emphasizing its crucial role in audio functionality. The article also guides users on verifying its legitimacy

why won't driver asio.sys loadwhy won't driver asio.sys loadMar 10, 2025 pm 07:58 PM

This article addresses the failure of the Windows asio.sys audio driver. Common causes include corrupted system files, hardware/driver incompatibility, software conflicts, registry issues, and malware. Troubleshooting involves SFC scans, driver upda

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)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools