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 6703317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:09:25+00:00 2026-05-26T07:09:25+00:00

Basically I have a school project where I must create a new wave file

  • 0

Basically I have a school project where I must create a new wave file from a given wave file. This new wave must be created in Matlab and the only difference is that a sine wave is to be mixed with the given wav file (not concatenated onto the end..). The sine wave is to be of 500hz.

My code so far is:

clear;
filename = 'C:\Documents and Settings\cmh0007\My Documents\rofl.wav';

[y, Fs, nbits, readinfo] = wavread(filename);
duration = numel(y) / Fs;

sinefs = 0:0.002:duration;
sinwave = 0.5*sin(2*pi*sinefs);

disp(size(y));
disp(size(sinwave));

newsignal = y + sinwave;

subplot(2,2,1), plot(y), title('Entire waveform');
subplot(2,2,3), plot(sinwave), title('sine waveform');
subplot(2,2,2), plot(newsignal), title('added waveform');

however, this code fails on creating the newsignal variable. The issue is that the two matrices are of different sizes due to the sampling rates differing between the two waves.

The output of the size calls are as follows:

     797696           2

       1           18089

Seeing as these files differ in sizes by a factor of ~44 I figured I could simply use the same sample from the sin wave 44 times over for each sample of the given wave file. However, because the difference is not exactly 44 I don’t know if this is even an option.

Does anyone have any suggestions on how to go about mixing these two files?

  • 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-26T07:09:26+00:00Added an answer on May 26, 2026 at 7:09 am

    Try changing 0.002 to 1/Fs. That way you’ll have the same sampling rate. You should also choose only one of the stereo channels for y and do an appropriate transpose.

    You might also consider changing the name sinefs to sinet or something as it represents the time parameter and not the sampling frequency.

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

Sidebar

Related Questions

I have a school project and i want to dedicate this for New Year,
My partner and I have a webcam site that basically runs the old-school method....Every
I basically have something like this: void Foo(Type ty) { var result = serializer.Deserialize<ty>(inputContent);
I basically have three tables, posts, images and postimages (this simply contains the ids
I basically have a server set up and I'm accepting new clients(UNIX) and i'm
I'm making a small game for a school project, and basically there are 20
Basically what I need to know is this: I have to show a drop
I have only really seen this once before, and it was in use on
For a school project, I need to create a way to create personnalized queries
I am currently doing a CRUD project for school and basically they want us

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.